5

We have an external application integrated with Salesforce that sends account information to Salesforce using the Soap API call upsert(), including status information. We have the problem that changes to the account sometimes happen so fast that one record is updated twice within one batch, and this is not supported by upsert() (see http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_upsert.htm: "When batch updating multiple records where the external ID is the same for two or more records in your batch call, those records will be marked as errors in the UpsertResult file. The records will be neither created or updated.").

We are now thinking of using update() instead, because update() can handle up to six calls to the same record within one batch. Now I need to know if update calls within one batch are processed in the same order as they where send to Salesforce.

In other words: If two update calls, the first setting the field status = 100 and the second one with status = 110, are processed within one batch, will the result always be that the status field is 110 and never 100?

4
  • Have you thought about deduping before sending to SFDC. If the external app makes two updates, is it possible to drop the first update? Or is this required for record keeping or for some other reason?
    – pchittum
    Sep 16, 2013 at 12:32
  • Hi Peter, yes, we also think about changing the way the external application sends the updates, but this would be considerably more effort than switching from upsert() to create() + update().
    – georg w.
    Sep 16, 2013 at 12:56
  • Understood. I'm asking the question internally. It would be good to get confirmation from "on high". Once I hear something I'll post back. Or maybe someone else will do so directly.
    – pchittum
    Sep 16, 2013 at 13:34
  • Deduping may be more effort upfront, but it may be cheaper and easier in the long-run, reducing maintenance costs and removing variables.
    – Mike Chale
    Sep 16, 2013 at 13:56

1 Answer 1

1

The only way to find the answer to this question is to test it. My suggestion would be re-architect the way you send the upserts to salesforce. A better approach might be:

  1. Send 1 record per upsert request at a time OR
  2. Send only the latest update in the upsert request instead of adding all updates to the upsert job. this is easier said than done, and may require adding a logic to check for uniqueness and only add the latest update to the batch sent in the upsert request.
2
  • Hi Anup, we are investigating these possibilities, but that would required more effort than changing to update. I am specifically looking for the processing order of updates within one batch. I was hoping that someone who has already tried this could share their knowledge.
    – georg w.
    Sep 16, 2013 at 13:43
  • I believe there was a point in time when the Import Wizard(s) would re-order rows for efficiency, but I've never observed an API case where the rows were specified in any other order than provided by the external application.
    – sfdcfox
    Sep 16, 2013 at 16:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .