2

Below is the scenario which we are facing now. Any help would be highly appreciated.

Step 1: Create account rest request

Step 2: Request sent out and received by salesforce and record is created

Step 3: Internet goes down, so mobile app do not get SalesForce ID

RestRequest req = null;
Map<String, Object> orderMap = Order.getOrderToSubmit(mNewItem);

if(mOrder.getId() != null && !mOrder.getId().equalsIgnoreCase("null") && !mOrder.getId().isEmpty()) {
    req = RestRequest.getRequestForUpdate(syncManager.apiVersion, Order.OBJECT_TYPE,
    mOrder.getId(), orderMap);
} else {
    req = RestRequest.getRequestForCreate(syncManager.apiVersion, Order.OBJECT_TYPE, orderMap);
}
RestResponse res = syncManager.sendSyncWithSmartSyncUserAgent(req);

Internet goes down after "res" call, so the record is created in SF but local order soup does not have SF ID

When internet/mobile data is available, the app does sync down and it creates one additional record which has SFID

The sync down option are as follows:

ParentInfo parentInfo = new ParentInfo(
        Order.OBJECT_TYPE,
        Order.SOUP_NAME,
        Constants.ID,
        Constants.LAST_MODIFIED_DATE
);
ChildrenInfo childrenInfo = new ChildrenInfo(
        OrderItem.OBJECT_TYPE,
        OrderItem.PARENT_REL_NAME,
        OrderItem.SOUP_NAME,
        OrderItem.PARENT_ID_NAME,
        Constants.ID,
        Constants.LAST_MODIFIED_DATE
);

Ideally, the app should merge records based on a account and purchase order number. if it matches, assign the SFID to local soup. How can we handle this scenario?

https://developer.salesforce.com/docs/atlas.en-us.mobile_sdk.meta/mobile_sdk/entity_framework_sync_related.htm?search_text=ParentChildrenSyncDownTarget

  • Have you ever found a solution? – zaitsman Apr 11 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.