NewThe Event Registration Agent is live. Watch the run on a real Salesforce org

Action buttons on a grid

Add buttons that pass selected rows to a flow, Apex, a quick action or your own Lightning component.

Who can
GridWorks Designer
Where
Grid Designer → Actions
Edition
Foundation (free)
Last updated

Add up to ten buttons to a grid. Each works on one row, the selected rows, or the whole grid (every record its filter matches, up to 2,000).

An action button opening a custom component with the two selected contact records
An action opening your own component with the selected records.
The button…Set it up with
Runs a screen flowA screen flow with a text input recordId (one row) or a text collection input recordIds
Runs a flow in the backgroundAn autolaunched flow with recordId or recordIds. A text output message is shown afterwards
Runs ApexA class that implements GW_GridAction, or any invocable method with recordId or recordIds. Take ownership comes ready-made
Runs a quick actionAny quick action of the object for one row; Create, Update and Log a Call actions for several rows
Opens a Lightning componentAny component that takes recordIds and fires done
Opens a linkAn https:// link or a Salesforce page, with {Field} values from the row
Opens a recordThe row's record, a record it looks up, or a new record

#Write an Apex action

apex
public with sharing class CloseDeals implements GW_GridAction {
    public GW_ActionResult run(GW_ActionRequest request) {
        List<Opportunity> deals = new List<Opportunity>();
        for (Id dealId : request.recordIds) {
            deals.add(new Opportunity(Id = dealId, StageName = 'Closed Won'));
        }
        update as user deals;
        return GW_ActionResult.done(deals.size() + ' deals closed.');
    }
}
  • request.recordIds: the checked records, all of the grid's object. Also objectApiName, gridKey, actionId and scope (row, selection or grid).
  • Return GW_ActionResult.done('message'). Call result.fail(recordId, 'reason') for records it could not handle.

#Open your own component

js
@api recordIds;     // the rows
@api recordId;      // the first row
@api objectApiName; // the grid's object

// when finished
this.dispatchEvent(new CustomEvent('done', { detail: { message: 'Notes added.' } }));

#Options and checks

  • Ask before running shows a confirmation first.
  • Show only when limits a one-row action to rows where a field matches, such as Stage is not Closed.
  • GridWorks checks every record first. Records of another object, deleted records and records the person can't see are skipped and reported. A failing Apex action changes nothing.

Request a demo

Request a demo

An architect shows you a live agent on a real Salesforce org and walks through how this one would work in yours. We reply within one business day.

No obligation. An architect replies, not a sales sequence.

Protected by reCAPTCHA. Google's Privacy Policy and Terms apply.