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).

| The button… | Set it up with |
|---|---|
| Runs a screen flow | A screen flow with a text input recordId (one row) or a text collection input recordIds |
| Runs a flow in the background | An autolaunched flow with recordId or recordIds. A text output message is shown afterwards |
| Runs Apex | A class that implements GW_GridAction, or any invocable method with recordId or recordIds. Take ownership comes ready-made |
| Runs a quick action | Any quick action of the object for one row; Create, Update and Log a Call actions for several rows |
| Opens a Lightning component | Any component that takes recordIds and fires done |
| Opens a link | An https:// link or a Salesforce page, with {Field} values from the row |
| Opens a record | The row's record, a record it looks up, or a new record |
#Write an Apex action
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. AlsoobjectApiName,gridKey,actionIdandscope(row,selectionorgrid).- Return
GW_ActionResult.done('message'). Callresult.fail(recordId, 'reason')for records it could not handle.
#Open your own component
@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.
