I have a Flow that creates several types of records:  Contract, Order and Order Products. Initially if the Flow encountered any errors on the DML elements it would report the ugly "Unexpected Fault" error screen and no data would be created. I added screens to handle "Fault" outcomes for the DML elements which worked well however if the fault occurred in later part of the Flow - for example when Order Products are inserted the previously inserted Contract and Order remained.

This is not ideal! Has anyone found a method to make sure the Flow does not create/update any data if there is a DML error that is handled by a fault message?

  • 1
    If possible you can try putting all the create and update elements after your last screen. That should make sure all the dml operations are in the same context, and are rolled back together if necessary. – Kasper Jul 27 '17 at 15:23
  • Sorry, i didn't read your question as well as i should have. Try making sure that the faults are never reached by checking for the conditions that cause the faults before the element that creates the fault. You can than do whatever is necessary to make sure that either no data is saved, or the error is handled by the user in the flow. (Btw, in flows all the data manipulation actions are committed before a screen is reached, so this is normal behavior. ) – Kasper Jul 27 '17 at 15:32

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.