Action forms
Introduction to action forms in ConSol CM
Action forms are used to display a form which the user needs to fill out when executing a contact, resource or search action. The provided data can be used to update the current object or to perform other operations which need to be implemented in the action script.
Concepts, terms and definitions
Concept |
Other terms |
Definition |
---|---|---|
contact action |
|
Action defined for persons or companies of a specific customer group |
resource action |
|
Action defined for resources of a specific resource type |
search action |
|
Action defined for the results of a detail search; can apply either to cases, or to persons or companies of a specific customer group, or to resources of a specific resource type |
Purpose and usage
Action forms are available for the following kinds of actions:
-
Cases: Search actions, see Search actions for cases
Manual actions for cases are implemented in the workflow using activities, which can have activity forms, see Activity forms.
-
Contacts: manual actions and search actions defined for persons or companies in customer groups, see Contact actions
-
Resources: manual and search actions defined for resource types, see Resource actions
Action forms can be used to link the input of certain data to an action. You can implement for example a search action to update a maintenance date in all found resources. The user can enter the new maintenance date in the form. Another example is a contact action which sends an email to the contact. The user can review the data which will be used in the email in the form before the email is sent.
Action forms can contain data fields of all objects types. They are not limited to the fields of the current object, i.e. the object from which the action is executed. This allows you to implement actions which create related objects, e.g. a contact action to create a case for the contact where the user provides basic data for the case in the action form. If the form contains fields from other object types, you need to handle the field values in the action script, see Action scripts.
If the form contains fields from the current object, the values set in the current object are shown in the form. You can decide whether the values entered in the form should be used to automatically update the current object accordingly, see Defining the binding of action forms.
Settings for action forms
The following settings are available in the Basic tab:
-
Internal name: Mandatory. The technical name of the action form.
-
Localized description: Optional. The localized description of the action form. Displayed below the name of the action in the Web Client.
The following settings are available in the Fields tab:
-
Assigned fields: Contains the fields which are used in the action form. By default, the fields are shown in the order of the list. You can change the order using the Move up and Move down icons. You can overwrite the default configuration in the Layout tab, which provides further settings.
The available fields can be filtered by the type of object (Cases, Contacts or Resources) or by entering the field or field group name in the search field.
The following settings are available in the Layout tab.
-
Form display size:
Determines the dimensions of the form. There are five sizes available: from S for small forms with few content to XXL for large forms with tables. -
Number of columns:
Determines the maximum number of columns used for the fields. 0 means that there is no limit. -
Field positioning:
Determines the position of each field in the grid. You can drag-and-drop fields to the desired position. If a position should remain empty, you need to click the Insert empty position button and drag the empty position to the desired place. You can increase the width or height of a field by clicking the arrow buttons on the right side of the field.For tables, it is recommended to use the full width, i.e. make the table span all columns.
You can click the Reset layout button to restore the default layout based on the order of the fields in the Fields tab.
Basic tasks
Using an action form
Proceed as follows to use an action form:
-
Create the action form on the page of the object type. This is Search forms for cases, Contact forms for contacts and Resource forms for resources.
-
Assign the action form to an action. This is done in the Forms tab of respective action. For cases, the actions are managed on the Search actions page, for contacts on the Contact actions page, and for resources on the Resource actions page.
-
After selecting the form, you can provide further optional settings related to the form:
-
Form condition script: Select a script which controls whether the form is shown.
-
Form prefill script: Select a script which fills the form fields with predefined values.
In the script, you can use the syntax formFields.set("fieldGroup:field", "value") to set values:
formFields.set("helpdesk_standard:country", "france")
If the form contains fields which are filled out in the current object, i.e. the contact or resource for which the action is executed, the values from the prefill script overwrite the values from the object.
-
Required fields: Select the fields which should be required, so the user must fill them out before saving the form.
-
-
Click the Update action button to save the changes.
Advanced tasks
Setting a dynamic description for the form
You can modify the description shown above the form fields by script. Use the following code in the form prefill script to overwrite the description from the basic form data with the content of a text template:
controlForm.setCustomDescription(templateService.mergeAndInlineImages("template name", engineerService.getCurrentLocale(), ticket.name))
For CM/Track, you need to use RequestLocale.get() for retrieving the user’s locale.