Process Builder is a way of automating business processes. It is an upgraded version of the Workflow Rule. Whenever a user creates a process, the system automatically creates a Visual Workflow – and a Flow Trigger (which is now deprecated) – to call the Flow. Creation of the Flow happens behind the scenes; and therefore, a user does not need to interact with these ‘shadow’ (behind the scenes) Flows. Process Builder is a powerful tool for system administrators and developers to implement business processes without writing code. However, with great power comes great responsibility – If a user starts creating a new process for each requirement – or creating processes without understanding Salesforce limitations – then, a user may encounter many issues, either in future or, during testing/deployment phase.
In my last post Getting Started with Process Builder – Part 64 (How to fix MIXED_DML_OPERATION error ), I discussed how to solve Mixed Data Manipulation Language (DML) Operation Error by using Time-dependent/Scheduled action. The Time-Dependent/Scheduled action separates DML operations, on Setup and non-Setup Objects, in the same Process, and, thereby, avoids incurring a Mixed DML operation error.
This article goes one step further; it discusses another common error – ALL_OR_NONE_OPERATION_ROLLED_BACK Error. The article shows – (1) why errors could occur; (2) how to identify errors (by using a debug log); and, finally, (3) how to solve the problem.
Business Use case
Donna Serdula is working as a System administrator at Universal Containers. They just implemented Quotation Management in Salesforce. Serdula has a requirement from her manager that, as soon as an Opportunity Stage is updated to Closed Lost then auto update related quotes status to Denied.
What is ALL_OR_NONE_OPERATION_ROLLED_BACK Error?
Let’s say that you have created a Process on the Lead object to perform some DML operation. Now you are updating 1K records via Data Loader, which triggers the Process on the Lead object. If the Process fails on any record due to a Validation Rule/Required Fields/Apex Trigger (intervening in between if you have any), it currently causes the entire batch to roll back and you will encounter ALL_OR_NONE_OPERATION_ROLLED_BACK Error.
Below, I will show you how, if there is a validation rule defined on an object, and the validation error conditions are met, a process fails and throws a rolled_back error at a user; then, I will show you how to use Dedug Log to debug ALL_OR_NONE_OPERATION_ROLLED_BACK Error and solve the problem in three easy steps:
Before we start, assume that there is a validation rule defined on the Quote Object. It states that the Description field must be populated – or cannot be null – if the Status field, on the Quote Object, updates to Denied. Also assume that the Description field, on one of the Quotes, was left blank.
In light of the above, first, let us update Opportunity Stage to Closed Lost. This will trigger our Process on the Opportunity Object and auto update related Quotes Status to Denied.
This, in turn, will generate an ALL_OR_NONE_OPERATION_ROLLED_BACK error because, as mentioned earlier, there is a validation rule defined on the Quote Object to make sure that, if someone updates the Status to Denied then, Quote Description field cannot be null.
It is not always easy, or apparent, as to why an error occurred. Therefore, one of your first go-to place, when an error is encountered, should be the debug log! So, let us go there!
Next, we will use Debug Log, to identify the root cause of Process failure.
And then, finally, we will update our Process – based on the root cause failure captured from the debug log – by populating the Description field and, thereby, solve ALL_OR_NONE_OPERATION_ROLLED_BACK error.