2024 Oct 01 8:42 PM - edited 2024 Oct 01 8:44 PM
Hi all,
I’ve established a basic parent-child association in my SAP on-premise backend and am consuming this OData service in my CAP application. However, while attempting to send a deep entity request to the backend, I consistently encountered the following error message:
'Property "0" does not exist in XXXItemSet'.
At first, I suspected an issue with our backend design, but after reviewing it thoroughly, we turned our attention to CAP since nothing seemed amiss with the backend.
The error message originated from the file /node_modules/@sap/cds/lib/linked/validate.js, and after some debugging, we identified the problematic check at line 202 (@sap/cds version 8.3.0):
else if (d['@cds.validate'] !== false) d.validate(data[each], path_, ctx)
To test this, I modified the CSN file by manually appending the @CDS.validateas false property to the generated association element. This allowed me to bypass the check and proceed with the process, eventually reaching the backend method successfully. Here’s the updated part of the CSN file:
"XXXItemSet": {
"@cds.validate": false,
"type": "cds.Association",
"target": "Dummy_SRV.XXXItemSet",
"cardinality": {
"max": "*"
},
"keys": []
},
Thanks!
Merve
Request clarification before answering.
I have to use the following method to achieve INSERT to avoid such issues:
const db = await cds.connect.to('db');
const { YourEntity } = cds.entities('Schema_Name_Space');
await db.run(INSERT.into(YourEntity).entries({ ID: 'Your_ID', ... }));
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
21 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.