Skip to Content
0
Nov 29, 2020 at 10:47 PM

Error when creating several entries CAP

58 Views Last edit Nov 29, 2020 at 10:53 PM 6 rev

Hi experts!!

I'm trying to save several entries in my external service, but it isn't work.

When i execute INSERT sentence for one register it works and it's saved in the database:

await tx.run((INSERT.into(location_sync, [{Werks: 'tes2', Stand:'test', Ktext: 'test'}])));

But when i try to do the same for a table of objects, the error is the same, returns 400 status Bad request: error while deserializing payload.

I have revised whole the fields and it seems it's all okay.

This is the csn imported from external service:

      "kind": "entity",
      "@cds.persistence.skip": true,
      "elements": {
        "Werks": {
          "key": true,
          "type": "cds.String",
          "length": 4
        },
        "Stand": {
          "key": true,
          "type": "cds.String",
          "length": 10
        },
        "Ktext": {
          "type": "cds.String",
          "length": 40
        }
      }

And this is the cds in the original service:

entity location_sync {
    key Werks : String(4);
    key Stand : String(10);
        Ktext : String(40);
}

Do you have some idea?

Thanks in advance!

Best regards