Newer Version Available
MacroInstruction
Supported Calls
create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete(), update(), upsert()
Fields
| Field Name | Details |
|---|---|
| MacroId |
|
| Name |
|
| Operation |
|
| SortOrder |
|
| Target |
|
| Value |
|
| ValueRecord |
|
Usage
MacroInstructions can specify objects, operations, conditions, and targets. For example, a macro containing these instructions performs a quick action that sends an email.
1Select Email QuickAction
2 Set Subject…
3 Set To…
4 Set Body…
5 SubmitYou can create conditional macros using IF, ELSEIF, ELSE, and ENDIF as operations. In a conditional statement, the ExpressionFilter and ExpressionFilterCriteria objects are used to control which instructions execute. The ExpressionFilter object lets you define a logical expression with one or more conditions. It uses a child object, ExpressionFilterCriteria, to represent each condition that is evaluated.
For example, consider the following conditional statement and macro instructions.
1IF (Case.Status EQUALS New) AND (Case.Origin EQUALS Phone)
2 Select Email QuickAction
3 Set Subject…
4 Set To…
5 Set Body…
6 Submit
7ELSE
8 Select Update Case Detail
9 Update Case Description…
10 Submit
11ENDIFThe ExpressionFilter object includes a FilterConditionLogic field containing 1 AND 2, where 1 and 2 are ExpressionFilterCriteria objects. The SortOrder field in the ExpressionFilterCriteria object maps condition 1 to Case.Status EQUALS New, and condition 2 to Case.Origin EQUALS Phone. If the conditional statement evaluates to true, then the instructions in the IF block are executed; otherwise, the instructions in the ELSE block are executed.
Any number of macro instructions can be present inside an IF, ELSEIF, or ELSE block. In addition, conditions can be nested.
Data Model
Associated Objects
This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version and later.
- MacroInstructionChangeEvent (API version 48.0)
- Change events are available for the object.