cancel
Showing results for 
Search instead for 
Did you mean: 

Error in updating order in OData V4 Model from a CAP Project.

santoshgowda
Participant
0 Kudos

I want to update an order in OData V4 Model from a CAP Project.

santoshgowda_0-1714197929358.png

The order has "array of string" ex : BO_DataTransferContent

var contextActBinding = oDataModel.bindContext('/RequestSet(' + dataObject.ID + ')', undefined, { $$updateGroupId: "$auto" });

Methord1
for (const [key, value] of Object.entries(dataObject)) {
contextActBinding.getBoundContext().setProperty(key, value);
}

error

santoshgowda_1-1714198237180.png

 

Method 2
for (const [key, value] of Object.entries(dataObject)) {
if (typeof value === 'object') {
contextActBinding.getBoundContext().setProperty(key, JSON.stringify(value));
} else {
contextActBinding.getBoundContext().setProperty(key, value);
}
}

santoshgowda_2-1714198304548.png

Any Solution?

Thanks in Advance

junwu
Active Contributor
0 Kudos
why don't you show us what the value is in debug mode?
View Entire Topic
Erkan
Explorer
0 Kudos

Hello santoshgowda,

Deserialization errors occur when the data does not match the type which is stated in OData service.

You may need to check following link, if you are using SQLite its being mapped to LargeString columns.

https://cap.cloud.sap/docs/cds/cdl#arrayed-types