on ‎2021 Apr 07 3:17 PM
Dear experts,
I am currently trying to create a new entry in my OData V2 model using the below code:
//Create entry:
oSubmitModel.createEntry(sPathToMyEntitySet, {properties: oMyNewObject});
//Submit changes to the Model:
oSubmitModel.submitChanges({
success: function () {
MessageToast.show("Material created.");
//Resfreh Model:
oSubmitModel.refresh(true);
},
error: function (oError) {
MessageToast.show("An error occured during changes submitting. Material has not been created.");
console.log("Error:", oError);
//Reset to previous state (before changes) and resfreh Model:
oSubmitModel.resetChanges();
oSubmitModel.refresh(true);
}
});<br>
The code above results in the following error:

I think this is caused by the fact that I did not use GroupIDs for the $batch operation but I can't find a way to do it.
How could I post some new entries on a remote OData V2 Service?
Thank you,
F.
Request clarification before answering.
Is the resource you are trying to perform a create on configured to allow HTTP Posts? This has to be set in the oData service. The error message could be because of the resource you are trying to create is read-only (GET). You could f.e. check SEGW for the CRUD flags.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.