How to Create Mass Actions from a List View
Want a quick way to update more than one record? Want to create related records without using a managed package, visual flow or data importer? Try adding a quick action to a list view.
Quick Actions make it easy.
Quick actions can give your users an easy way to update or create a record, run a flow, or do even cooler stuff through custom lightning components and Visualforce pages, all with the click of a button.
For this tutorial, we're going to show you the power of quick actions by giving you a way to update a group of opportunities through a list view.
Step 1: Create a Quick Action
Head to the object manager in the setup menu (Setup > Object Manager) and navigate to 'Opportunity'. Find 'Buttons, Links and Actions' in the side menu. Then click 'New Action'.
Now go ahead and define the characteristics of your action. For this example, we'll set the following parameters:
Action Type | Update a Record
Standard Label | None
Label | Close Donations
Name | Close_Donations
Description | Close a donation and fill out deposit date
Success Message | Donation Closed
Step 2: Customize the Quick Action's Page Layout
If you've ever adjusted a page layout in Salesforce, this next part is going to feel mighty familiar. Drag and drop fields from the list of object fields (in our case, 'Opportunity fields'). Arrange the fields in a way that makes most sense for what you're trying to do.
In our case, we'll be placing two fields on the quick action. Opportunity 'Stage' and a custom date field called 'Deposit Date'.
Once the fields are on the layout, click 'Save'.
Salesforce will complain about not having all required fields on the quick action layout. Here's why you don't need to worry:
We're designing an update action - which means all required fields already exist on the record.
We only want to update the fields the user needs for this specific action -- updating the opportunity stage and deposit date.
Because we want this action to be used for multiple records, we only want to set the common values for all the records we're updating. So -- these two fields are exactly what we need.
'Wait' you say - what about setting our pre-defined values? Because we're using our quick action in a list view (to perform mass actions), we don't set pre-defined values.
For mass actions, only the fields that are manually modified are changed. Setting a default in this case would make it harder for our users to actually make a change.
Step 4: Add The Quick Action to The List View
Now that we have our quick action, let's add it to our list views. Navigate to the 'Search Layouts for Salesforce Classic' menu item.
Click on the action button under the 'List View' layout. Then click 'Edit'.
Scroll down to the section entitled 'List View Actions in Lightning Experience' and move our new 'Close Donations' button into the list.
Aaaand... that's it! We can now access our quick action from a list view.
Step 5: Perform Mass Action
Head over to the opportunities tab. Then select a custom list view (mass actions don't appear on Recently Viewed). Let's select 'Opportunities closing this month'.
See the checkboxes down the left side? Select the opportunities you want to update. Then click the button we just created - "Close Donations'.
Set the values you want for these fields. Then click 'Save'.
Voila! You've successfully created and performed a mass action from a list view.
What's next is up to you.
Updating multiple records using quick actions is only the beginning. Quick actions can also be used to create related records.
Need to create pledged opportunities for a group of accounts? Create a mass quick action.
Did your donor developer send personal notes to a number of contacts on her caseload - and she wants to log an activity? Create a mass action.
Get creative. Have fun. And get some action... on mass.