How to create a user-defined custom action in XRL
The Salesforce Hypergrid Extended Related List Actions tab allows you to perform various actions on the records displayed in the related list. Some of the actions that can be performed include creating a new record, editing an existing record, deleting a record, mass editing records, and exporting data to a CSV file. The actions available may vary depending on your user permissions and the configuration of the related list.
In this article, we will understand how to create a new custom action and define its settings.
Prerequisite XRL view is configured and a view is created on a record page. Refer to the articles below to know how XRL is added to the page view and how to create a Related List view in XRL.
|
Which type of user can add a new action in records?
The Actions functionality is available for all users in the HyperGrid- Standard and Power Users. It is one of the default actions that users view in the Related List View. However, please note that only a Power User can create a new custom action.
Create a new custom Action
We will work with Cases XRL to walk you through the steps to customize an action.
Step 1: On the Configuration Wizard, click on the Actions tab.
Step 2: Click on the New Action tab and enter the Unique Action id name. Click Save.
Step 3: Enter the details of the New Action to customize it as explained below.
- Id of the action: This refers to a unique identifier assigned to each action that is created. For default actions, the system generates this identifier and it cannot be changed or modified manually. However, for custom actions like in this example, it can be modified or changed.
- Label of the action: This label is used to identify the action within the user interface. In this example, we are defining it as NewCustom.
- Tip for the action: The option allows you to add a custom message or tip to an action in the related list. This message will appear as a tooltip when the user hovers over the action button in the related list. This can be useful for providing additional information or guidance to users about the action they are performing. In our example, we are defining it as “A new custom action tip”.
- Callback function: This feature allows you to define a function that will be executed when an action is performed on a record in the related list.
- Hide this action: Select this checkbox to hide the action button from the grid.
-
Action visible only after record selection: This action will be visible only after selecting the record.
- Variant: Select the variant bare from the drop-down list. The variant property lets you specify a style for these custom actions. You can easily customize the look and feel of your related list and ensure that the actions are distinguishable from one another by selecting a specific variant for each action.
- Name of the icon to be shown: This refers to the specific icon that will be displayed on the grid. This icon can be chosen from a library of icons provided by Lightning Design System that can be found at “www.lightningdesignsystem.com/icons/”. By choosing a specific icon, users can add visual cues and distinguish between different types of related records. In this example, we will define it as a utility: answer.
- Refresh Grid after Custom Action Execution: This option allows you to refresh the grid view automatically after a custom action is executed. This means that when you perform a custom action, the grid view will be updated with any changes made by the action without having to manually refresh the page. To enable this option, simply tick the "Refresh Grid after Custom Action Execution" checkbox. Once enabled, the grid view will automatically refresh after executing any custom actions.
- Order of the action: This property specifies the order in which the actions appear in the related list. It is critical to use appropriate values when configuring this property, such as 10, 20, 30, and so on. This is due to the fact that using sequential values like these allows for greater flexibility, as new actions can be easily added between existing ones without disrupting the order of the entire list.
- API name of the flow: The "API Name of the Flow" field is optional. This field is only used if you want to run a flow when the user clicks the action button. By entering the flow's API Name in this field, you can allow end users to execute that flow when they click the action button in the extended related list. This field is automatically selected to None by default and cannot be modified.
Step 4: Once you have defined all the properties of the action, click Save.
Results
The above procedure results in the Related List view with the new custom action.