User interface (UI) actions are buttons, links, and context menu items on forms and lists. They allow you to customize the UI to be more interactive, adjustable, and comfortable for working.

Role required: admin.

UI action types

  1. On forms:
    • Header left
    • Header right
    • Burger menu
    • Field label context menu
    • Link
    • Bottom
  2. On lists:
    • Header left
    • Header right
    • Burger menu
    • Column header context menu
    • Row context menu
    • Link
    • Bottom
  3. Other:
    • Button context menu
    • Dependency map context menu

UI actions on form



UI actions on list


Customize UI actions

You can create new or customize existing UI actions.

To do so, complete the following steps:

  1. Navigate to System Definitions → UI Actions.
  2. Click New or select an existing UI-action.
  3. Customize UI-action using the form provided.
  4. Click Save or Save and exit to apply the changes.

UI Action form fields

FieldMandatoryDescription
NameYSpecify a UI action name. This text is displayed on the button, link, or as a context menu item.
TableYSpecify a table to display UI action on. 
ParentNSpecify the context menu item to be a parent for the current UI action (applicable for the Burger Menu UI action type).
CommentsNType a brief description of the action.
ActiveNSelect this checkbox to display the UI action on the form (list, context menu).
InheritsNSelect this checkbox to make this UI action available for all child tables of the table specified in the Table field.
OrderNSpecify the order of the displaying. If there are UI actions of the same type, they are arranged in the ascending order.
Overrides byN

Specify a UI action that will be overridden by the current UI action.

Conditions and Actions
Show insertNSelect this checkbox to display this UI action on a new record form.
Show updateNSelect this checkbox to display this UI action on an existing record form.
Wait server responseN

Select this checkbox to specify that the system should wait for the server response after the button is clicked. All the buttons with this setting on the page become inactive until the server responds.

ClientNSelect this checkbox to specify that this UI action is only performed on the client side (in the user's browser).
ConditionNSpecify a condition using server-side API. If this condition is met, then the button is displayed on the page.
ScriptNSpecify a script that is executed by clicking the UI action.
URLN

Specify a URL that is displayed after clicking the UI action. You can use variables listed below:

VariableDescription
{CURRENT_TABLE}The name of the current table whose records contain the UI action.
{CURRENT_ID}ID of the current record on which the UI action is called.
{CURRENT_FORM_VIEW}The name of the form view on which the UI action is called.
{CURRENT_RELATED_LIST_VIEW}The name of the related list view on which the UI action is called.
{CURRENT_TABLE_ID}ID of the table that is the current one for the UI action.
{CURRENT_LIST_VIEW}The name of the list view on which the UI action is called.
{LIST_TABLE_NAME}

The table name for the list displayed on the current page.

If the current page path is /list, the variable value equals to the {CURRENT_TABLE} variable value. If the current page path is /record, the variable value contains the name of the active related list.

{LIST_TABLE_ID}

The table ID for the list displayed on the current page.

If the current page path is /list, then this variable value equals to the {CURRENT_TABLE_ID} variable value. If the current page path is /record, then this variable value contains the name of the active related list.

{RELATED_COLUMN_NAME}This variable returns column name containing the referenced table ID.
{RELATED_LIST_ELEMENT_ID}This variable returns the active related list element ID.
{CURRENT_RELATED_ID}This variable returns the current related record ID.
{CURRENT_FORM_ID}This variable returns the current form view ID.
Position and Style
Use forN

In this block of fields, select the options defining where this UI action should be displayed. Available options are:

List type:

  • Lists+Related Lists – this UI action should be displayed on both lists and related lists.
  • Lists this UI action should be displayed on lists only.
  • Related Lists this UI action should be displayed on related lists only.

If Lists+Related Lists or Related Lists options are selected, then a set of checkboxes appears where you can define on which related list types this UI action can be displayed. You can select more than one option.

These options display relation types between the related list elements and the parent table.

For example: the User Criteria related list contains the Users field of the List type. This field is related with the Users (user) table, so this related field is of the List field type.

By selecting and unselecting appropriate checkboxes, you can place the UI action you are creating on the related list of the corresponding type.

Option

Example

Reference field typeChild Categories related list on Menu Categories record form.
List field typeIndicator related list on Agreement record form.
Document ID field typeScript Log related list on Script form.
Scripted listTranslations related list on Column record form.
M2M typeUser Group, User Roles related lists on User record form.
Form buttons
Form styleN

The style of buttons on the form view. Available options:

  • Unstyled
  • Primary
  • Positive
  • Negative
  • Secondary

Header leftNSelect the checkbox to display the button in the form header on the left.
Header rightNSelect the checkbox to display the button in the form header on the right.
Burger menuNSelect the checkbox to display the action as the context menu item on the form.
Field label context menuNSelect the checkbox to display the an item of the context menu for the fields on the form.
LinkNSelect the checkbox to display the link on the form.
BottomNSelect the checkbox to display the button at the bottom of the form.
List Buttons
List styleN

The style of buttons on the form view. Available options:

  • Unstyled
  • Primary
  • Positive
  • Negative
  • Secondary.

Header leftNSelect the checkbox to display the button in the list header on the left.
Header rightNSelect the checkbox to display the button in the list header on the right.
Burger menuNSelect the checkbox to display the action as a burger menu item on the list.
Column header context menuNSelect the checkbox to display the action as a context menu item for the elements of the list.
Row сontext menuNSelect the checkbox to display the action as a context menu item on the list.
LinkNSelect the checkbox to display the action as a link on the bottom of the list.
BottomNSelect the checkbox to display the button at the bottom of the list.
Button context menuNSelect the checkbox to display the action as a context menu item for UI actions of the button type.
Dependency map context menuNSelect the checkbox to display the action as a menu item on the service model form.


You can edit some types of the UI actions like buttons and links in a quick way. To do so, complete the steps below:

  1. Right-click the UI action you need to edit to open a context menu.
  2. Click Edit UI action. The UI action form appears.

Global UI actions


You can make a UI action displayed on all tables.

To do that, follow the steps below:

  1. Open the UI action record desired.
  2. On the form, specify the Global table in the Table field.
  3. Click Save or Save and exit to apply the changes.

Most burger menu items and some buttons on the forms (New, Save, Save and exit) and lists (New, Delete) are global.

Embed a UI action


The UI action functionality allows you to create multi-level submenu options by embedding items to the burger menu within the forms and lists. 

This option is only available for the UI actions of the Burger menu type.

To embed a UI action, follow the steps below:

  1. Create a parent UI action, specify its type with the Burger menu checkbox in the Form style or List style area of the Position and Style tab.
  2. Click Save and exit to leave the form.
  3. Create a child UI action of the same type specifying its Parent option with the UI action created before.
  4. (optional) Select the Inherits checkbox to enable the UI action on the child tables.
  5. Click Save to apply the changes.

Display condition configuration


The condition option defines the situations when UI actions displayed. By default, this field supports the server-side API. Select the Client checkbox to switch the available API to the client-side API. In the Condition field, use the current object of the certain record to access a UI action. This object can only be used for the UI actions that are displayed on forms. 

Call the current object within the UI actions during the update since this object is defined. When creating a new UI action, the current value is null.

Use logical operators && (AND) and || (OR) to compose the complex conditions.

Use conditions to call the created Script Include on the server-side. 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.


Use the ss object to call the SimpleSystem methods.

This UI action is a reference to the record with the ID of the getTableName table. If a record exists, the function returns true, and it returns false when there is no record found. Depending on the value returned, the function displays the UI action or not.

Example
function wfContextExists(recordID, tableName){
  const table = new SimpleRecord('sys_db_table');
  table.get('name', tableName);
  const wfContext = new SimpleRecord('wf_context');
  wfContext.addQuery('related_record_id', ss.getDocIdByIds(table.sys_id, recordID));
  wfContext.selectAttributes('sys_id');
  wfContext.query();
  return (wfContext.getRowCount() > 0)
}

Define a UI action behavior with a script


The Script field defines the UI action behavior. By default, this field supports the server-side API. Select the Client checkbox to switch the available API to the client-side API.

For example, this UI action adds an informational message with the Description field content:

UI action
ss.addInfoMessage(current.description);

When the current object is called, it is not necessary to use the initialize() method; the object context is already initiated.

  • No labels