Introduction: Dynamic Action
Dynamic Actions in Salesforce allow users to choose which actions need to appear in the Highlights Panel on the object’s record page. Hence, we can now control visibility of each action based on factors that we specify.
What are Dynamic Actions in Salesforce?
Dynamic Actions enables you to create uncluttered, intuitive, and responsive pages that display only the actions your users need to see based on the criteria you specify.
Instead of scanning an endless list of actions, your users will be presented with a simple choice, relevant to their role, profile, or when a record meets certain criteria.
Lightning App Builder
The actions which are available and when they appear can be configured in the Lightning App Builder instead of the traditional page layout editor, resulting reduced administrative time and effort. Dynamic Actions will be available in your production environment from the Summer ‘20 release.
1.Log into your Salesforce Organization
2.Click on Setup
3.On the Quick Find enter & navigate to “Lightning App Builder”
4.Click on the [New] button and select “Record page” on the “Create a new Lightning page”
5.Enter a value for “Label” and select your desired custom object and click on the [Next] button
6.e.g., My custom object “Deltek Timesheet” (on any Lightning Page for a custom object and selected standard objects from Winter ‘21 release)
7.Select any one of the Standard Page Templates on “Create a new Lightning page” and click on the [Finish] button
8.Click and drag your desired page layout section.
Note: Highlight panel is the most needed to enable Dynamic Actions.
9.Select the Highlights Panel and tick “Enable Dynamic Actions (Beta, desktop only)”. You will need to do this on every Lightning Page you wish to use Dynamic Actions.
10.A new option “Add Action” will be displayed, and it adds our Dynamic Action into place.
Note: In case of editing the existing page layout, if you do not already have a Highlights Panel component on, you will need to add one.
Get Started with Dynamic Actions
Let us start planning on how you are going to use your new Awesome Admin powers to design the action layout on your Lightning Page.
Evaluate the business process for your custom objects and what actions are needed when and by whom.
- Add universally required actions
After enabling Dynamic Actions on your Lightning Page, click “Add Action” to get started adding actions. You can start by adding universally required actions i.e. actions that should always be available such as “Clone” or “Edit”.
Note: Do not forget what a user can do is still controlled by their profile and permission sets. Just because you add “Edit” as an action, it will not grant users the right to edit a record.
- Reorder actions
You can also reorder actions at any time by simply dragging and dropping (in the same way you reorder tabs).
- Make an action conditionally visible based on a field value
This is an example: Only a Project Manager/Team Lead should be able to approve timesheets entered by their respective Team Members if none has already been approved. We know the status of the timesheet entry by the value defined in the “Approval Status” field on the record page.
With the Highlights Bar selected, you must choose “Add Action” and find my “Yet to Approve” action.
Next, you must click on “+ Add Filter” and add my display criteria. In this instance, you only want to display my action “Yet to Approve” if the “Approval Status = Pending for Approval”. Click “Done” to finish.
You will know if an action is conditionally displayed because it will have an eye icon next to it.
Let us now check it out in action! When “Approval Status = Pending for Approval” is displayed, our user has the action available to Approve/Reject/Reassign by clicking on “Yet to Approve”.
As soon as the “Approval Status = Approve/Reject/Reassign” is displayed, the action disappears.
- Make an action conditionally visible based on a user’s profile
You will have an action that should only be used by certain users, roles, or profiles, and you will be probably controlling visibility via different page layouts.
With Dynamic Actions, you will no longer need separate page layouts to control the visibility of actions because you can do it from the Lightning App Builder.
In the second example, resource timesheet information should be sent only to their Team Lead for Approval if the field value for the Project is “Bench”.
With the Highlights Bar selected, I choose “Add Action” and find my “Send To Team Lead for Approval” action.
Next, you must click on “+ Add Filter” and add the display criteria. You must select the “Advanced” filter type option. In this instance, you only want to display my action if the user’s profile is “Team Lead”. Click “Done” to finish.
When you look at the resource record there is no action! That is exactly what we want to see because only the Team Lead profile should see it and hence you need to log into Salesforce with the System Administrator profile.
- Add mobile actions (beta)
You can add the same dynamic actions to the mobile layout by selecting “Enable dynamic actions from the Highlights Panel for the Salesforce mobile app (Beta)” from the Winter ‘21 release.
You can also use a different set of dynamic actions on mobile. With your record page open, select the Page properties pane and select “Enable page-level dynamic actions for the Salesforce mobile app (Beta)”.
Dynamic Action is an instant upgrade to improve productivity and it is the next step within the evolution of Lightning record pages in Lightning Experience Salesforce.