Mass Quick Actions (and their error management) in Lightning Experience
Mass Quick Actions help users to create or update multiple records at the same time.
This feature is available only in Lightning experience on the list view of standard objects like Cases, Leads, Accounts, Campaigns, Contacts, Opportunities, Work Orders, and custom objects.
We will see in the article how to setup a mass action and how end user will use it.
How to setup a mass quick action
Go to Setup / Object Manager / MyObject / Buttons, Links and Actions
Create a New action
Select the action type, the label and name, and eventually a success message.
Save.
Edit the Layout of the quick action
Place the fields you want to display to the end user when he click on the mass action.
Set some predefined values
In our example, we use a checkbox and control the behavior with a trigger or workflow but you can set other fields you want there (example : A status field and a close date field)
Update the search layouts
This is a mandatory step to make the action available on listviews
How end user will use the mass action
The “Mass close” button is available on all the Jobs listviews on the top right (except on the recently view) :
The user has to select one or more record in the listview to be able to use the mass action.
When he clicks on the button, a popup is displayed containing the mass action layout (remember our one and unique field) :
When the user clicks the Save button, the success message is displayed in a toast message:
Now, let’s see what happens if the mass action failed to update one or more records …
Error management
Salesforce standard mass action error management is one of the most underrated functionnality at the moment : no complete documentation on the salesforce help site, no mention on any blog.
When the mass action failed, a toast message is displayed at the top of the page :
but that’s not all :
- A “Quick Action Errors” toolbox at the bottom right of the page displayed the error detail of each records.
- In front of each lines where the mass action record update failed, a red triangle is displayed with the error detail:
Salesforce documentation
Set up a Mass Quick Action: https://help.salesforce.com/articleView?id=mass_quick_actions_create.htm
Mass Quick Action considerations: https://help.salesforce.com/articleView?id=mass_quick_actions_considerations.htm