cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to get response of backend with Offline OData Upload

SW10
Discoverer
0 Kudos
388

In my MDK application, I am trying to access the backend's response through an OfflineOData Upload action.

Actions/UploadChanges.action:

{
    "Service": "/MyApp/Services/MyService.service",
    "_Type": "Action.Type.OfflineOData.Upload",
    "ActionResult": {
        "_Name": "upload"
    },
    "OnSuccess": "/MyApp/Rules/ErrorArchive/ErrorArchive_CheckForSyncError.js",
    "OnFailure": "/MyApp/Actions/UploadFailureMessage.action"
}

 

As seen I have added the "upload" ActionResult. In the OnSuccess Rule I have added this code:

var uploadResult = context.getActionResult('upload');

But the upload result is only this: 

Object {data: null, error: undefined, status: 0, enabled: true}

 Tested with MDK-Client 24.7.0

Accepted Solutions (0)

Answers (2)

Answers (2)

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert
0 Kudos

@SW10 Error archive will list only the rejected requests from the backend.

Jitendra_Kansal78
Product and Topic Expert
Product and Topic Expert
0 Kudos

@SW10 This an expected behavior. The ActionResult of the Offline upload action returns null. See documentation here.

In order to see if backend has rejected any request, you have to look into ErrorArchvie queue. You can find some details in this tutorial on how to enable error archive in an MDK app.

SW10
Discoverer
0 Kudos

Thanks for your reply. I'm trying to see the response of the accepted request from the backend. Is there something similar to the ErrorArchive but for accepted responses?