You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 63 Next »

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.

UI action inheritance and override


In SimpleOne, you can inherit the UI actions and then override their logic, scripts, order, name, or any other feature.

Inheritance rules

  1. The following UI actions are applied to forms and lists:
    • UT actions inherited and not overridden by the Overrides by option on the current level of inheritance.
    • The overridden on the current level functionality of the inherited UI actions.
    • UI actions specified on the current level.
  2. A UI action inherited on the 1st level with the override functionality specified on the 2nd level cannot be applied on the 3rd level of inheritance. An inherited UI action specified on the 2nd level may be applied to the 3rd one.
  3. A UI action inherited on the 1st level with the override functionality specified on the 3rd level cannot be overrided on the 2nd level. In this case, the system warns of active override option and requires for its deactivation.

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 needed.

To inherit a UI action, complete the steps below:

  1. Make a UI action parent by setting the Inherits checkbox active and clicking Save.
  2. Make a UI action child by specifying the Parent field with the UI action you want, then customizing the record.
  3. Click Save to apply changes.

To override a UI action, complete the steps below:

  1. Open the child UI Action form.
  2. In the Overrides by field, specify a parent UI Action that should be overridden.

UI actions types


  1. Form Button
  2. Form Header Button
  3. Form Bottom Button
  4. Form Context Menu
  5. Form Field Label Context Menu
  6. Form Link
  7. List Banner Button
  8. List Bottom Button
  9. List Burger Menu
  10. List Table Header Context Menu
  11. List Context Menu
  12. List Link
  13. List Header Right Button
  14. Button Context Menu
  15. Dependency Map Context Menu

UI actions on form



UI actions on list


UI actions customizing


You can create new or customize existing UI actions.

To do this, please 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 changes.

You can edit some types of UI actions like buttons, links in a quick way. For this, please complete the steps below:

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

Global UI Actions

You can make a UI action display on all tables.

To do that, follow the steps below:

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

Most hamburger menu items and some buttons on forms (New, Save, Save and Exit) and on lists (New, Delete) are global.

Embed a UI Action

UI action functionality allows creating multi-level submenu options by embedding items for the hamburger 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:

  1. Create a parent UI action specifying its type with the Form context menu or List burger menu checkboxes on 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 UI action created before.
  4. (Optional) Set the Inherits option active.
  5. Click Save to apply changes.

Display condition configuration

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 definition
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)
}

Defining UI action behavior with a script


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.

UI action
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.

UI Action form description


FieldMandatoryDescription
NameYUI action name. It specifies a text displayed on the button, link, or as a context menu item.
TableYA table to display UI action on. A form or a list or a context menu should be used.
CommentsNUI action brief description.
ActiveNMark this checkbox to display the UI-action is displayed on form (list, context menu).
InheritsNWhen 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 byN

This field specifies UI action, which will be overridden by current UI action.

OrderNThe displaying order. If there are over one UI-actions of the same type, then they will be arranged in ascending order.
ParentNSpecify the context menu item to be a parent for the current UI action (applicable for the Form Context Menu UI action type).
Use forN

Choose a list type where this UI action should be displayed. Available options are:

  • 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 Both or Related lists options are selected, then a checkboxes set appears where you can define on which related list types this UI action can be displayed. You can select more than one option.

Option

Example

Reference field typeChild Categories related list on Menu Categories record form
List field typeUser Criteria related list on Service Catalog 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
Conditions and Actions
Show InsertNWhen set to TRUE, this UI action is displayed on a new record insert form.
Show UpdateNWhen set to TRUE, this UI action is displayed on an existing record form.
Wait Server ResponseNWhen set to TRUE, the system will wait for the server response after clicking the button. The button will be disabled until the server responds.
ClientNWhen set to TRUE, client-side API is available in the Script field; otherwise, server-side API is available.
ConditionNA condition written using server-side API. If this condition is be met, then the Script will be executed.
ScriptNThe script that will be executed by clicking the UI action.
URLN

This URL will be followed after clicking the UI action. You can use variables listed below there:

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

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

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

{LIST_TABLE_ID}

The table ID for the list displayed in 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
Form StyleN

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

  • Unstyled
  • Primary
  • Positive
  • Negative
  • Secondary.

Form Bottom ButtonNButton at the bottom of the form.
Form ButtonNButton in the form header on the right.
Form Context MenuNContext menu item on the form.
Form Header ButtonNButton in the form header on the left.
Form LinkNLink on the form.
Form Field Label Context MenuNAn item of the context menu for the fields on the form.
List StyleN

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

  • Unstyled
  • Primary
  • Positive
  • Negative
  • Secondary.

List Banner ButtonNButton in the list header on the left.
List Bottom ButtonNButton at the bottom of the list.
List Burger MenuNA hamburger menu item on the list.
List ChoiceNMenu item for actions applicable to list entries.
List Header Right ButtonNButton in the list header on the right.
List LinkNLink on the bottom of the list.
List Table Header Context MenuNA context menu item for the elements of the list.
List Context MenuNContext menu item on the list.
Button Context MenuNA context menu item for UI actions of the button type.
Dependency Map Context MenuNMenu item on the service model form.


  • No labels