0

I am using flow for number of mass update through list view and custom button. It was working since last year. User select set of records (less than 200) and click custom button. It will invoke flow which do series of insert,update,delete operations.

Recently , user reported an peculiar issue which never happened during testing. The flow errored out with CPU limits apparently user was mass updating large data. Issue is part of the records get updated after error message(first two or three steps executed for all selected records). I wonder why flow partial updated. I can only suspect spring 2018 critical updates https://releasenotes.docs.salesforce.com/en-us/summer18/release-notes/rn_forcecom_flow_run_partialsave.htm

Partial update for create and update.

What we need is ALL or None operation. I contacted salesforce they said its out of support as customized. Is there any way I can stay out of partial update for create and update in flow. Please help

  • A CPU limit error would be expected to roll back the entire transaction. Can you provide more information about the structure of your Flow, including whether it uses Apex, Wait elements, or Platform Events? – David Reed Mar 18 at 2:42
  • It uses invocable Apex to query list of selected id , loop through collection variable for processing and with final collection variable updated, it repeated for child object and updated child object. there are two other DML steps too. No wait or platform events. there are screen elements – Athimathi Sachithanandam Mar 18 at 2:49
0

When you pass records into a flow from a list view button, you can operate on all of them in a sObject collection variable, and then update the collection. That update will be a single transaction, and should be all-or-none.

The release note link specifies that it only applies to processes that create or update records. If the process calls a flow, it is specified to be all-or-none.

When your flow displays a screen, that is the end of the transaction, as SFDC Fox indicates. Up until the screen, you should have all-or-none behavior, and if any record fails the entire transaction should be rolled back.

Note that if you have fault handling setup in your flow, and the error is able to be handled, then that will not cause a rollback of the rest of the flow.

1

Each Screen operates as a single "transaction." Once you reach a Screen, everything up to that point is committed. This is not the same as a "partial update," which refers to records within the same transaction independently succeeding/failing. The system is operating as expected. Even if you had "All or None" functionality, it wouldn't help in your case, because the data changes are already committed. You may need to move to pure Visualforce or a Lightning Component to get better control over the transactions.

  • thanks for your response. If I move every update process to sub flow ,would that help. – Athimathi Sachithanandam Mar 18 at 21:37
  • @AthimathiSachithanandam Unless your flow can execute entirely without a screen, that won't help. You need to be able to get all your updates in to a single transaction if you want all-or-none behavior. Like I said, you may need to move to Apex code, although even that might not be enough. There are limits in place for a reason. – sfdcfox Mar 19 at 1:09

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.