Form Actions
How to add form action
Open "Tools" menu and click "Form Actions" (1).
Click "Add Action" button (2) in the "Form Actions" popup:
New action form will appear.
Action has mandatory field "Title" and optional "Description".
Action can have conditions that should be matched to execute it. Turn checkbox "Has conditions" on to configure conditions.
You can create form actions of following types:
Select "Update Value" action type (3), click "Add" button (4).
'Update Value' actions perform updates of following entities:
- Form - representing list of form elements that can be updated
- Variables - form variables
- Context - context object of the form (e.g. "Case")
Source for the update can be of one of the following types:
- Parameters - parameters passed to the action
- Form - form elements values
- Variables - form variables
- Context - context object of the form
- Static - static value provided by user
Select target context and field/variable to be updated (5).
Select source context and field/value to update target with (6).
"Global Action"/"Global Action Group" actions trigger global action/group execution and allow you to use the results of execution in form config.
Select proper type in "Type" picklist and populate other fields:
Name (7) - click Settings icon (8) and select an action/group. Click Arrow icon (9) to open selected action in new tab (if no action/group is selected yet, an icon will be "+" and will open new action/group creation form).
Source (10, optional) is id of a record that is used as a data source for global action. You can set it directly of configure with merge field constructor (click icon 11).
Set variables (12) if you need to pass parameters to global action. Follow the sequence of step to add and set variables in the popup appeared:
Result Handlers are form actions that are executed once global action execution is done. Click icon (13) to select and configure them (they should be configured at the form first).
You can pass parameters to Result Handler actions if necessary - click Settings icon (15) for setup. Follow the sequence of steps to add set parameters in the popup appeared.
NOTE: Output context on Parameters Setup screen represents variables that were set while Global Action execution. Config below uses newCaseId variable that was created by Global Action.
"Global Action Group" form action setup is same as "Global Action".
Turn Checkbox on to disable spinner that is shown by default while action is executing.
For more information about usage of Global Actions and Global Action Groups please refer to the following documentation: Actions/Action Groups
'Refresh' actions perform refresh of one of the following form elements:
- Form itself
- Lists
- Related Lists
- Lookups
- Nested Forms
Select "Refresh" action type (16) and select target element of form (17) to be refreshed:
About refreshing lookups: this action makes lookup field re-evaluate it's conditions that records are shown by.
E.g., lookup conditions contain a variable that is used to filter records in this lookup. If this variable is updated by user (as a result of some manipulations on current form), an Refresh action must be triggered to force Lookup field show records matching new variable value.
"Form API" actions execute one of the following methods:
- Save - saves context object
- Reset - resets the original values of all fields in a form
- Clear - removes values from all form inputs
- Show Notification - displays notification to user
- Validate - validates form inputs and shows error if some of them are blank
- Print Form - allows to create a PDF version of the Form, which can be printed
- Fire Event - fires lightning event. It can fire aura application event or force event
- Execute Form Actions - runs action (or group of actions) on the current form/nested form/parent form
- Close - closes current form
- Calculate - performs calculations/executes formula on the form (available from version 5.0)
- Update Process Instance Variables - allows to update variables in specified Process Instance (available from version 6.0)
Select necessary method in the "Form Action Type" picklist (34).
Save:
Check "Disable Validation" checkbox (35) if you need save data that does not match form validation rules.
Select type of Success Message (36). If you want to get rid of it, select "None" (available from version 5.0). To override default message select "Custom Message" and configure it (37).
Configure Extended Fields (38) if needed (available from version 5.0).
Only fields existing in the form will be passed by default onto the server when form is saved. You can add Extended fields - any object fields to be passed and saved in spite of their absence on the form.
Show Notification:
Select Notification Type (39).
Populate or configure "Title" (40) and "Text" (41).
Validate:
Select where validation should be performed (42).
Configure "Message" (43) if you need to inform users.
Fire Event:
Populate Event name (in namespace:name format) (44). Fire Event action example (force event).
Specify event parameters (45) if needed.
Execute Form Actions:
Specify Timeout (46) - it is optional setting to delay form action execution.
Select "Form" (47) and click "Add" button (48).
Based on what form is selected (current form or nested form), "Action" will display list of current form actions or nested form actions (49).
Configure parameters if needed (50).
If you check "All Forms" (51) - you can execute action from any form in your organization.
Starting from version 6.0 actions to be executed by this action type can be "Execute From actions" type too - so, if necessary, user can trigger a chain of Form Actions, even on different forms.
Calculate Form Actions:
Configure calculation expressions. Specify output variable name (52) and expression which evaluation result will be a value of output variable (53). You can configure several output variables.
Results of calculations should be passed to some other action (result handler) (54).
Configure parameters of result handlers (55) and select action (action should be configured at the form first).
Handler action updates form field with the calculation result:
Update Process Instance Variables (available from version 6.0):
- Select Process Instance from the list (58) by clicking button (56) or use editor (55) to type Process Instance ID or select Merge Field
- Specify Variables defined on that Process Instance, and their values (57)
0 Comments
Add your comment