2025 Feb 10 10:22 PM - edited 2025 Feb 11 12:39 AM
Hi,
I have a problem during the update of Offline entity with backend errors.
I have two Entity:
During creation of Sales Order I Sync to Backend a ChangeSet with two Create Operations for both Header Data and Items. If the ChangeSet does not throws Errors all were synced and saved correctly to backend. If the ChangeSet throws Errors the Order is stored in the Offline Store with @SAP.inErrorState=true and @SAP.isLocal=true.
{ "_Type": "Action.Type.ODataService.ChangeSet", "ActionResult": { "_Name": "ChangeSetUpdateSalesOrder" }, "OnFailure": "/app/Rules/CreateSalesOrder/ChangeSetUpdateSalesOrderFail.js", "OnSuccess": "/app/Actions/ClosePageAndSync.action", "Target": { "Service": "/app/Services/ServiceV2.service" }, "Actions": [ "/app/Actions/EditSalesOrder/UpdateSalesOrderHeader.action", "/app/Rules/EditSalesOrder/UpdateSalesOrderItems.js" ] }
import Utility from "../Utility/Utility"; /** * Describe this function... * @param {IClientAPI} clientAPI */ export default async function UpdateSalesOrderItems(clientAPI) { //get page proxy let pageProxy = clientAPI.getPageProxy(); //get Application Client Data let applicationClient = pageProxy.getAppClientData(); //get items let items = pageProxy.getAppClientData().Items; if (items) { for (var i = 0; i < items.length; i++) { items[i].OrderS = Utility.getHeaderPageKey(clientAPI); pageProxy.setActionBinding(items[i]); if (items[i].isNew && items[i].isNew === true) { await clientAPI.executeAction("/app/Actions/CreateSalesOrderActions/CreateSalesOrderItems.action"); } else { if (applicationClient.isOrderLocal) { await clientAPI.executeAction("/app/Actions/EditSalesOrder/UpdateSalesOrderItems.action"); } else { await clientAPI.executeAction("/app/Actions/CreateSalesOrderActions/CreateSalesOrderItems.action"); } } } } return Promise.resolve(); }
{ "_Type": "Action.Type.ODataService.UpdateEntity", "ActionResult": { "_Name": "UpdateSalesOrderItems" }, "Target": { "Service": "/app/Services/ServiceV2.service", "EntitySet": "ItemSet", "ReadLink": "{@odata.readLink}" }, "Properties": { "Delete": "{Delete}", "DiscountPos": "{DiscountPos}", "Discount": "{Discount}", "OrderS": "{OrderS}", "Posnr": "{Posnr}", "Matnr": "{Matnr}", "RefHigh": "{RefHigh}", "EAN": "{EAN}", "CustMaterial": "{CustMaterial}", "ShipTo": "{ShipTo}", "Qty": "{Qty}", "UM": "{UM}", "DataCons": "{DataCons}", "Tester": "{Tester}", "Value": "{Value}", "Url": "{Url}", "Storage": "{Storage}", "TypePos": "{TypePos}", "Plant": "{Plant}", "DescriptionMat": "{DescriptionMat}", "AddItem": "/app/Rules/Application/Conversion/ConvertItemAddItem.js", "DiscScale": "{DiscScale}" }, "RequestOptions": { "RemoveCreatedEntityAfterUpload": true, "UpdateMode": "Replace" } }
Request clarification before answering.
After reading a lot of the MDK Help Guides I found the solution:
After reverting the errors in Error Archive I was able to send a new Change Set request to backend.
Without this procedure, the ChangeSet Fails because of dependent requests.
Error like: This request was not executed because it depended on request (N).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
53 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.