0

I have a flow which loops through assets and adds the asset's status to a text variable. The last element in the flow is an update element which updates a status field on the corresponding asset's account. When I try to update the account status field I hit the 'maximum number of duplicate updates in one batch' limit.

I created a collection variable so that I can update more than 12 assets at a time, but then it still doesn't update the account field.

Is there a way to take the value from the asset text variable, assign it to the account status field, and avoid the maximum number of duplicate updates error?

0

The salesforce api only allows 12 updates to the same id one transaction. It seems to be you are updating the account 12 times as you have more than 12 assets.

As a solution iterate assets first and update the accounts only one time with your business logic.

| improve this answer | |
  • Thank you for the information. I have only one element that is updating account record at the end of the flow. I am basing the criteria off of account Id equaling a resource variable accountId. Then I update/set the account field. Is it possible to take all of the asset values and assign them to the account field? – AL 600 Apr 1 '19 at 13:08
  • Hi @AL600, Could you please share your code with me, It will easy for me to understand. Thanks. – Piyush Apr 1 '19 at 15:08
  • Hi Piyush, Step 1. Get the asset records. For the conditions I have: AccountId = {!varastAccID} 2. Then we loop through the assets using the {!AssetCollection} collection variable and {!AssetLoopVart} loop variable. 3. For each item, set {!AssetFamily} variable to the value of the asset record's product family {!AssetLoopVar.ProductFamily__c}. 4. Decision element where if the AssetLoopVar.ProductFamily equals null then add it to the {!FamilyList} variable. 5. After all assets have been updated, then update the account's status field based off of the {!FamilyList} value. Thank you. – AL 600 Apr 1 '19 at 15:37

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.