Introduction
If you need your users to see only actions that are relevant to them, Dynamic Action comes into play. Actions can be made available in Salesforce pages that are displayed based on certain criteria such as user’s role, profile or when a record meets certain condition. This article provides an overview of how Actions can be created in Salesforce pages.
Lightning App Builder
Actions can be configured in the Lightning App Builder instead of the traditional page layout editor, in terms of when they will appear thus reducing administrative time and effort.
The Lightning App Builder is a point-and-click tool that makes it easy to create custom pages for the Salesforce mobile app and Lightning Experience. It is an UI for building pages without coding. We can build three types of lightning pages viz.,
And you can do all of the following and much more with Dynamic Actions
Add, reorder, and remove actions directly from within the Lightning App Builder, with a modern UI and live preview.
Use visibility rules to show and hide actions to ensure users see only what is important to each of them, at a given time.
Manage the actions on your pages in the Lightning App Builder without touching the page layout editor.
Reduce the number of page layouts you need with action visibility rules.
Take advantage of a single assignment model for the Lightning page instead of the dual model of assigning a Lightning page and a page layout.
Enabling Dynamic Actions
For you to start dealing with Dynamic Actions, you need to first enable the feature. You will enable Dynamic Actions from within the Lightning App Builder and this is how you do it
Using Dynamic Actions
Now we are all set to start taking advantage of the enormous power that Dynamic Actions brings in. First step, however, is to ensure you do a proper planning of what actions are required, when & how, for your custom object.
Click 'Add Action' to get started with adding actions
Select the Action that you want always and to everybody such as Edit or Clone
PS:- Even if the action is added here, it is still controlled by their profile and permission sets. Like an “Edit” action will still require users to have the Edit permission for the record.
Actions can be reordered in the same way tabs are reordered by simply dragging and dropping.
A situation where a customer needs to be Signed up for a Care Package only if the customer is not a Care Package Member already. In such a situation, the action Sign Up for Care Package needs to appear based on the value of a field and this can be done as follows
Click Add Action to add action to your highlights panel and select the Action that you want to add, in this case 'Sign Up for Care Package'.
Click Add Filter to assign visibility rules for the action.
You could add a rule that only displays the action if a user has a specific profile, or if the record data meets a specific criteria, in this case, if the value of the field 'Copy of Passport Recieved?' is false as shown below
The action will appear only if the field condition is met.