Action Class
Namespace
Usage
The getDescribe() method returns detailed metadata about an invocable action, including its inputs, outputs, and configuration. Because this method retrieves comprehensive describe information, it can have performance implications. Use getDescribe() judiciously, especially in performance-sensitive contexts such as loops or frequently executed code paths.
When calling createStandardAction() or createCustomAction(), the version parameter is optional. If you don't specify a version, the base version of the action is used.
Example
1// Create an action and get its metadata
2Invocable.Action action = Invocable.Action.createStandardAction('someActionName');
3List<Invocable.Action.DescribeResult> describeResults = action.getDescribe();
4
5for (Invocable.Action.DescribeResult dr : describeResults) {
6 System.debug('Action Name: ' + dr.getName());
7 System.debug('Action Label: ' + dr.getLabel());
8 System.debug('Description: ' + dr.getDescription());
9 System.debug('Has Callout: ' + dr.getHasCallout());
10
11 // Access input parameters
12 if (dr.getInputs() != null) {
13 for (Invocable.Action.InputParameter input : dr.getInputs()) {
14 System.debug('Input: ' + input.getName() + ' (' + input.getType() + ')');
15 System.debug('Required: ' + input.getRequired());
16 System.debug('Description: ' + input.getDescription());
17 }
18 }
19
20 // Access output parameters
21 if (dr.getOutputs() != null) {
22 for (Invocable.Action.OutputParameter output : dr.getOutputs()) {
23 System.debug('Output: ' + output.getName() + ' (' + output.getType() + ')');
24 }
25 }
26}
27Action Methods
These methods are for Action.
addInvocation()
Signature
public Invocable.Action addInvocation()
Return Value
Type: Invocable.Action
clearInvocations()
Signature
public Invocable.Action clearInvocations()
Return Value
Type: Invocable.Action
createCustomAction(type, namespace, name, version)
Signature
public static Invocable.Action createCustomAction(String type, String namespace, String name)
Parameters
Return Value
Type: Invocable.Action
createCustomAction(type, namespace, name)
Signature
public static Invocable.Action createCustomAction(String type, String namespace, String name)
Parameters
Return Value
Type: Invocable.Action
createCustomAction(type, name)
Signature
public static Invocable.Action createCustomAction(String type, String name)
Parameters
Return Value
Type: Invocable.Action
createStandardAction(type, version)
Signature
public static Invocable.Action createStandardAction(String type)
Parameters
Return Value
Type: Invocable.Action
createStandardAction(type)
Signature
public static Invocable.Action createStandardAction(String type)
Parameters
- type
- Type: String
- Type of invocable action.
Return Value
Type: Invocable.Action
invoke()
Signature
public List<Invocable.Action.Result> invoke()
Return Value
Type: List<Invocable.Action.Result>
isStandard()
Signature
public Boolean isStandard()
Return Value
Type: Boolean
This method returns true if the invocable action is a standard invocable action.
setInvocationParameter(parameterName, parameterValue)
Signature
public Invocable.Action setInvocationParameter(String parameterName, Object parameterValue)
Parameters
- parameterName
- Type: String
- Name of the invocable action parameter to set.
- parameterValue
- Type: Object
- Value to set the invocable action parameter to.
Return Value
Type: Invocable.Action
setInvocations(invocations)
Signature
public Invocable.Action setInvocations(List<Map<String,ANY>> invocations)
Return Value
Type: Invocable.Action