List Actions

List Actions in AGrid function similarly to Row Actions but are designed for the entire list view. AGrid provides both custom and standard actions to enhance user functionality within the list view.

Standard List Actions

You can find the following actions listed under the “Standard” tab. Admins can activate or deactivate any of these actions except the Preferences.

Custom List Actions-20240228-142500.png
List Action - Standard Section Details

Create

Enable this option to allow end-users to create records action at the table level.

Bulk Create

In addition, to allowing users to create one record at a time, AGrid also provides an option to Bulk Create records at the table level.

You can find this option if you click the “edit” option you see for the “Create” List action.

  • If Enable Bulk Create is set to true, end-users can create one or multiple new records for the selected primary object.

  • If Enable Bulk Create is false, end-users can create a new record of the selected primary object.

  • AGrid utilizes Standard Salesforce to create record action, respecting field-level security and page layout assignments.

Setting up Default Values

The Default Value Option empowers administrators to set default values for fields in AGrid's configuration, simplifying record creation.

  • Admins can specify default values for fields within the configuration.

  • These default values auto-populate the field when a record is created.

  • When multiple record types are available and the "Create" option is enabled with a default value, it streamlines record creation without requiring users to go through a record type selection module.

Bulk Create - Default values-20240227-144450.png
List Actions - Setting up Default values for Create Action

Delete

  • Enable this option to allow end-users to bulk delete records action at the table level.

  • All the users have to do is select multiple records on the AGrid List view and then hit the “Delete” icon listed as List Action

Export

  • Enable this option to allow end-users to export records as a CSV file from the list view.

Focus Mode

  • Enable this option to allow end-users to switch to full-screen mode.

  • Clicking on the Manage link navigates to the Preference tab.

Preference

Clicking on the Manage link, you will be navigated to the Preference tab.

Custom List Actions

Custom Actions allow users to define personalized actions within the AGrid List View, offering options to edit, delete, and clone these custom actions.

List Action Section Details

  • Action Name: The name of the List Action.

  • Display As: The action can be a Button or Icon.

  • Action: Supports 3 actions – Flow, Lightning Web Component, and Lightning Component.

How to create List Actions

  1. On the Configuration Page, navigate to the List Actions tab.

  2. Click the Add List Action button.

  3. Provide a name in the Action Name field.

  4. Select whether the action should be a Button or Icon in Display As.

  5. Based on the selected action, the Target will be rendered.
    a. For Flow and Lightning Component - Select the target.
    b. For Lightning Web Component – Enter its name in the target.

  6. Click the Add Fields button to add action variables.

  7. Select the action variable name in the Name field.

  8. Enter or select a value for the action variable in Global Variable.

  9. Click Save.

Note: If a List View contains Row Action or List Action, drag and drop the AGrid Helper component on that page. Avoid placing the helper component inside a tab or an accordion component.

 Passing Values in the Actions

Users can pass values to actions in two ways:

  1. Value:
    a. Directly enter a value for the action variable.

  2. Global Variable:
    a. Utilize Global Variables to select values in two ways:
    AGrid: Pass values such as Intelligent Filter Api Name, Parent Field Name, Parent Id, Record Id, and SObject.
    i.  Intelligent Filter Api Name: Pass the unique name of the Intelligent Related List defined in the Intelligent Related List API Name in Lightning App Builder.
    ii.  Parent Field Name: Pass the Name defined in the Parent Field Name in Lightning App Builder.
    iii.  Parent ID: Pass the Record ID of the current record detail page to actions.
    iv.  Selected Record Ids - Pass IDs of the selected records in AGrid List View to actions.
    v.  Selected Records - Pass Fields added in Column section to actions.
    SObject: Pass the current record context value of the selected object in Configuration.

List Action Types

Launch a Flow

Imagine your sales representatives spending excessive time manually reviewing and approving discount requests submitted by the sales team across various accounts from a list view. This leads to reduced productivity and is time-consuming. With the "Launch a Flow" List Action Type in AGrid, your team can execute a predefined flow to automate repetitive tasks, such as updating opportunity stages, directly from the AGrid list view.

How to Pass RecordIds from AGrid to Flow?

  1. Create a Flow Variable
    a. Create a variable named "recordIds" in Flow with "Allow multiple values" set to "true".
    b. Save your changes.

  1. Configure List Action in AGrid
    a. On the Configuration page, go to the "List Action" tab.
    b. Select the desired Flow to pass the recordIds.

  1. Assign Value to Action Variable
    a. Choose "recordIds" as the source variable.
    b. Select "Selected Record Ids" from "AGrid->Selected Record Ids" as the target.
    c. Save your changes.

NOTE: To assign a value to the Action variable, you can either enter a value directly or use a global variable to pass the value. If you choose to use a global variable, you can toggle between the value and the global variable. 

  1. Test the Functionality
    a. Select multiple rows in AGrid.
    b. Trigger the associated Flow.
    c. Verify that the recordIds are passed to your custom variable and displayed on the Flow screen.

Note: Repeat the same procedure for ParentId, Parent Field Name, and Intelligent Filter Api Name to pass values to Flow.

Launch a Lightning Component

In Salesforce, users frequently require bulk updates or intricate operations on multiple records within a list view. While Salesforce supports individual record edits within a list view, it lacks the ability to apply custom business logic or integrations. The "Launch a Lightning Component" List Action Type in AGrid fills this void by enabling users to seamlessly launch a Lightning Component directly from the list view.

How to Pass RecordIds from AGrid to Lightning Component?

  1. Define Lightning Component Attribute
    a. In the developer console or your preferred code editor, create a new Lightning Component or open an existing one that you want to modify.
    b. In the Lightning Component markup file (.cmp), declare a new attribute, e.g., "recordIds".

  1. Configure List Action in AGrid
    a. On the Configuration page, go to the "List Action" tab.
    b. Select the Lightning Component to pass the recordId.

  1. Assign Value to Action Variable
    a. Choose "recordIds" as the source variable.
    b. Select "Selected Record Ids" from "AGrid->Selected Record Ids" as the target.
    c. Save your changes.

  1. Test the Functionality
    a. Select multiple rows in AGrid.
    b. Trigger the associated Flow.
    c. Verify that the recordIds are passed to your custom variable and displayed in the Lightning Component.

Note: Repeat the same procedure for ParentId, Parent Field Name, and Intelligent Filter Api Name to pass values to the Lightning Component.

Launch a Lightning Web Component

Imagine having a whole setup for updating sales process details in a Lightning web component. However, doing it manually for each record or running it for a specific record could be time-consuming. With the "Launch a Lightning Web Component" List Action Type in AGrid, your sales team can efficiently access a custom Lightning Web Component from the list view. This streamlines the process of updating custom fields across multiple records, ensuring accuracy, and speeding up your process.

How to Pass RecordIds from AGrid to Lightning Web Component?

  1. Declare Lightning Web Component Attribute
    a. In the Lightning Web Component markup file (.html), declare a new attribute, e.g., "recordId".

  1. Configure List Action in AGrid
    a. On the Configuration page, go to the "List Action" tab.
    b. Select the Lightning Web Component to pass the recordIds.

  1. Assign Value to Action Variable
    a. Choose "recordIds" as the source variable.
    b. Select "Selected Record Ids" from "AGrid->Selected Record Ids" as the target.
    c. Save your changes.

  1. Test the Functionality
    a. Select a row in AGrid.
    b. Verify that the recordIds are passed to your custom variable and displayed in the Lightning Web Component.

Note: Repeat the same procedure for ParentId, Parent Field Name, and Intelligent Filter Api Name to pass values to the Lightning Web Component.