Skip to main content
edited tags
Link
Ganesh Sanap - MVP
  • 47.4k
  • 22
  • 32
  • 64
Source Link

Error handling for a Patch and SubmitForm()

I have this formula inside the Submit Button:-

Patch('Printing Orders Details', ForAll(PrintOrderDetailsGallery.AllItems, { ID: ID, Quantity: Value(PrintOrderQuantity.Text), 'Quantity Each Artwork':PrintOrderQuantityForEachartwork.Text, 'Network ID':PrintOrderNetworkComboBox.Selected.ID } ) ); SubmitForm(PrintOrderForm) 

Which Patch some items and submit a form. but currently if the Patch raised an error, i will get an error message for each Patch (so if i have 5 items inside the ForAll, i will get 5 error messages)>> but at the same time the submit form will be executed,,, which will result in an inconsistent state of our data.. so how i can ensure that the Submit Form will only be executed if all the Patches inside the ForAll went successfully, if not to still show errors for each Patch ?