Form Actions

How to add a form action

Open the "Tools" menu and click "Form Actions" (1).

Click the "Add Action" button (2) in the "Form Actions" popup:

Populate the Title, Description (optional), and Type fields.
If the Form Action has conditions that must be matched  in order for it to execute, check the "Has Conditions" checkbox.

You can create form actions of following types: 

1. 'Update Value' action type

Select "Update Value" as the Type (3) and click the "Add" button (4).

'Update Value' actions perform updates on the following Target entities (5):

  • Form - specific Form elements that can be updated
  • Variables - Form Variables
  • Context - the context object of the Form (e.g. "Case")

The Source (6) for the update can be set to one of the following types:

  • Parameters - parameters passed to the action
  • Form - form element values
  • Variables - form variables
  • Context - the context object of the form
  • Static - a static value provided by user

NOTE: When you use "Update Value" action and update some Context Object field (as on the screenshot above), the updates you make to these fields will not be included in Save; such fields will be virtually stored as properties on the Object-type variable. When you want some fields that are not present on the Form to be included in Save, use Extended Fields.

2. "Global Action" and "Global Action Group" action type

"Global Action"/"Global Action Group" actions trigger global action/group execution and allow you to use the results of that execution in Form config.

Select the desired Type from the picklist and populate the remaining fields:

Name (7) - click the Settings icon (8) and select an action/group. Click the Arrow icon (9) to open the selected action in a new tab (if no action/group is selected yet, the icon will be "+" and will open the new action/group creation form).

Source (10, optional) is the ID of a record that is used as a data source for the global action. You can set it directly or configure it with the merge field constructor (click icon 11).

Set Variables (12) if you need to pass parameters to the global action. Follow the sequence of steps below to add and set variables in the Variables popup:

Result Handlers are form actions that are executed once global action execution is done. Click the gear icon (13) to select and configure them (they should be configured on the Form first).

You can pass parameters to Result Handler actions, if necessary. Click the Settings icon (15) for setup. Follow the sequence of steps to set the parameters in the popup.

NOTE: Output context on the Parameters Setup screen represents variables that were set during Global Action execution. Config below uses the newCaseId variable that was created by Global Action.

"Global Action Group" form action setup is same as "Global Action".
Check the Disable Spinner checkbox (14) to disable the spinner that is shown by default while the action is executing.

For more information about usage of Global Actions and Global Action Groups please refer to the following documentation: Actions/Action Groups

3. "Refresh" action type

'Refresh' actions perform a refresh of one of the following form elements:

  • Form itself
  • Lists
  • Related Lists
  • Lookups
  • Nested Forms

Select the "Refresh" action type (16) and select the target element of the form (17) to be refreshed:

The Refresh action makes lookup fields re-evaluate the conditions by which records are shown.

E.g., lookup conditions contain a variable that is used to filter records in this lookup. If this variable is updated by the user (as a result of some manipulations on the current form), a Refresh action must be triggered to force the Lookup field to show records matching the new variable value.

5. 'Form Api' action type

"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 the defined notification to user
  • Validate - validates form inputs and shows error(s) if some of them are blank
  • Print Form - creates a PDF version of the Form, which can be printed
  • Fire Event - fires a Lightning event. This can be an 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 - updates variables in a specified Process Instance (available from version 6.0)
  • Execute Workflow Line Action - allows for proceeding steps, reloading the progress line, and executing buttons in the Process Instance (available from version 8.4)

Select the desired method in the "Form Action Type" picklist (34).

Save:

Check the Disable Validation checkbox (35) in order to bypass form validation rules and save the data.
Select a Success Message (36). Select "None" if no message is desired. (available from version 5.0). To override the default message, select "Custom Message" and enter the desired Message (37).
Configure Extended Fields (38) if needed (available from version 5.0).

Only fields existing in the form will be passed by default to the server when the form is saved. Defining Extended Fields allows any object fields to be passed and saved despite their absence on the form.

From the version 8.4 there are several improvements are added to Save action:

  • Ignore permissions checkbox. Allows user to save changes in spite of user's permissions related to saved record.
  • Component. Allows to select what to save. If select "current form",  all changes in it will be saved. If select some list or related list, only changes that are made in it will be saved.

Notes:

  • To make lists changed user should turn "inline edit" feature on for them. Only changes made with inline editing will be saved.
  • Extended fields will be saved for each changed record in the list, not for all of them.

Show Notification:

Select Notification Type (39).
Enter the desired Title (40) and Text (41).

Validate:

Select where validation should be performed (42).
Configure the Message (43) that will be displayed to users when validation fails.

Fire Event:

Populate the Event Name (in "namespace:name" format) (44).
Specify event Parameters (45), if needed.  

Execute Form Actions:

Specify Timeout (46) in order to optionally delay the form action execution.
Select the Form (47) and click the "Add" button (48).
Based on which Form is selected (current form or nested form), the Action picklist will display a list of current form actions or nested form actions (49).
Configure Parameters if needed (50).

If the All Forms box (51) is checked, the action can be executed from any form in your organization.

Starting from version 6.0 actions to be executed by this action type can also be "Execute From Actions" type actions, allowing the user to trigger a chain of Form Actions, even on different forms.

Calculate:

Configure calculation expressions. Specify the output variable Name (52) and configure the Expression (53), which will result in the value of output variable. Several output variables may be configured.

Results of calculations should be passed to some other action (Result Handler) (54).

Configure Parameters for the Result Handlers (55) and select the desired Action (56, which should be already be configured on the form).

 The Handler Action updates the specified form field with the calculation result:

Update Process Instance Variables (available from version 6.0):

  • Select the Process Instance from the list (58) by clicking the configuration icon (56) or use the editor (55) to type the Process Instance ID or select a Merge Field
  • Specify Variables defined on that Process Instance and their values (57)
WR_BPM__Form__c | Salesforce - Google Chrome
WR_BPM__Form__c | Salesforce - Google Chrome

Execute Workflow Line Action (available from version 8.4):

Select the desired Action (59):

Form - Test Execute Workflow Line Actions | Salesforce - Google Chrome
  • Proceed Step - allows Proceed/Approve/Reject operations to be executed with the current step. Select the Operation (60) and specify Comments (61), if desired:
Form - Test Execute Workflow Line Actions | Salesforce - Google Chrome
  • Reload Line - reloads the current Progress Bar with all of its components (this action is equal to the menu item of the same name in the Progress Bar menu). Check Reload Connected Instances (62) if you also want to reload visible subflows and connected processes.
Form - Test Execute Workflow Line Actions | Salesforce - Google Chrome
  • Update Proceed Button - modifies the visibility and enablement of form buttons, as well as changing their labels (the text shown on buttons) and tooltips (the text shown when buttons are hovered over). Select the desired visibility/enablement setting (63) and enter the desired label and tooltip (64), as needed:
Form - Test Execute Workflow Line Actions | Salesforce - Google Chrome

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.