UI actions are buttons, links, and context menu items on forms and lists. They allow customizing the UI to be more interactive, adjustable, and comfortable for working.
Role required: admin. |
In SimpleOne, you can inherit the UI actions and then override their logic, scripts, order, name, or any other feature.
Inheritance rules
The system provides UI Actions inheritance with the Inherits option. When a UI action has a Table specified, and the Inherits option is defined with TRUE, the system applies this UI action to all children tables of the one specified before. To child UI actions, the reference Parent option defines an ancestor UI action with functionality options may be overridden if you need it. |
To inherit a UI action, complete the steps below:
To override a UI action, complete the steps below:
You can create new or customize existing UI actions.
To do this, please complete the following steps:
You can edit some types of UI actions like buttons, links in a quick way. For this, please complete the steps below:
|
You can make a UI action display on all tables.
To do that, follow the steps below:
Most burger menu items and some buttons on forms (New, Save, Save and Exit) and on lists (New, Delete) are global. |
UI action functionality allows creating multi-level submenu options by embedding items for the burger menu within forms and lists.
This option is only available for UI actions of the Form context menu and List burger menu types. |
To embed a UI action, follow the steps below:
The condition option defines situations when UI actions displayed. The Condition field expects using server-side API, but in some cases, it is possible to apply client-side API. To enable client script use, on the UI action form, set the Client option checked. Within Condition, to access a UI action, use the current object. This object may be used only for UI actions displayed on forms.
It makes sense to invoke current within UI actions on updating since this object is defined in this situation. When creating a new UI action, the current value is NULL.. |
Use logical operators && (AND) and || (OR) for making up the complex conditional expressions.
Condition option allows invoking server-side Script Includes created. In the example below, the function wfContextExists() of Script Include with the same name gets current.sys_id and current.getTableName as recordID and tableName arguments.
The ss object allows invoking the SimpleSystem methods. |
This UI action is a reference to the record with the sys_id of the getTableName table. If a record exists, the function returns TRUE, and, in the opposite, it returns FALSE when there is no record found. Depending on the value returned, the function displays the UI action or not.
function wfContextExists(recordID, tableName){ let table = new SimpleRecord('sys_db_table'); table.get('name', tableName); let wfContext = new SimpleRecord('wf_context'); wfContext.addQuery('related_record_id',ss.getDocIdByIds(table.sys_id, recordID)); wfContext.query(); return Boolean(wfContext.getRowCount()) } |
The Script field defines the UI action behavior in the form field. In there, you can determine UI action behavior logic using Server-Side API. For example, this UI action adds an informational message on every table field with the Description field content.
ss.addInfoMessage(current.description); |
When the current object is invoked there, it is not necessary to use the initialize() method; the object context is already initiated. |
Field | Mandatory | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | Y | UI action name. It specifies a text displayed on the button, link, or as a context menu item. | ||||||||||||||||||||||||||
Table | Y | A table to display UI action on. A form or a list or a context menu should be used. | ||||||||||||||||||||||||||
Comments | N | UI action brief description. | ||||||||||||||||||||||||||
Active | N | Mark this checkbox to display the UI-action is displayed on form (list, context menu). | ||||||||||||||||||||||||||
Inherits | N | When set to TRUE, this UI action is propagated to all the tables that are a child for the table specified in the table field. | ||||||||||||||||||||||||||
Overrides by | N | This field is specifying UI action, which will be overridden by current UI action.
| ||||||||||||||||||||||||||
Order | N | The displaying order. If there are over one UI-actions of the same type, then they will be arranged in ascending order. | ||||||||||||||||||||||||||
Parent | N | Specify the context menu item to be a parent for the current UI action (applicable for the Form context menu UI action type). | ||||||||||||||||||||||||||
Use in | N | Choose form where the UI-action is displayed. Available options are:
| ||||||||||||||||||||||||||
Conditions and Actions | ||||||||||||||||||||||||||||
Show Insert | N | When set to TRUE, this UI action is displayed on a new record insert form. | ||||||||||||||||||||||||||
Show Update | N | When set to TRUE, this UI action is displayed on an existing record form. | ||||||||||||||||||||||||||
Wait Server Response | N | When set to TRUE, the system will wait for the server response after clicking the button. The button will be disabled until the server responds. | ||||||||||||||||||||||||||
Client | N | When set to TRUE, client-side API is available in the Script field; otherwise, server-side API is available. | ||||||||||||||||||||||||||
Condition | N | A condition written using server-side API; if this condition will be met, then the Script will be executed. | ||||||||||||||||||||||||||
Script | N | The script that will be executed by clicking the UI action. | ||||||||||||||||||||||||||
URL | N | This URL will be followed after clicking the UI action. You can use variables listed below there:
| ||||||||||||||||||||||||||
Position and Style | ||||||||||||||||||||||||||||
Form Style | N | Button appearing style on the form view:
| ||||||||||||||||||||||||||
Form Bottom Button | N | Button at the bottom of the form. | ||||||||||||||||||||||||||
Form Button | N | Button in the form header on the right. | ||||||||||||||||||||||||||
Form Context Menu | N | Context menu item on the form. | ||||||||||||||||||||||||||
Form Header Button | N | Button in the form header on the left. | ||||||||||||||||||||||||||
Form Link | N | Link on the form. | ||||||||||||||||||||||||||
Form Field Label Context Menu | N | An item of the context menu for the fields on the form. | ||||||||||||||||||||||||||
List Style | N | Button appearing style on the list view:
| ||||||||||||||||||||||||||
List Banner Button | N | Button in the list header on the left. | ||||||||||||||||||||||||||
List Bottom Button | N | Button at the bottom of the list. | ||||||||||||||||||||||||||
List Burger Menu | N | A burger menu item on the list. | ||||||||||||||||||||||||||
List Choice | N | Menu item for actions applicable to list entries. | ||||||||||||||||||||||||||
List Header Right Button | N | Button in the list header on the right. | ||||||||||||||||||||||||||
List Link | N | Link on the bottom of the list. | ||||||||||||||||||||||||||
List Table Header Context Menu | N | A context menu item for the elements of the list. | ||||||||||||||||||||||||||
List Context Menu | N | Context menu item on the list. | ||||||||||||||||||||||||||
Button Context Menu | N | A context menu item for UI actions of the button type. | ||||||||||||||||||||||||||
Dependency Map Context Menu | N | Menu item on the service model form. |