1 Introduction
The form component BOX allows JavaScript function execution, as well as statement execution, on a record in the result set. This is referred to as an "action". Actions will be displayed in a context menu when right-clicking an element of the box.
XSQL statements or JavaScript functions can be executed on a record by simply right-clicking.
As a starting point, SQL-Tree requires the basic Axional Studio infrastructure, which includes:
- Axional Studio Server, properly installed
- Dictionary database
- A target database
** The previous configuration is explained in detail in the Axional Studio/Setup section.
2 Architecture
Actions allow statements or JavaScript functions to be executed:
- Statement Execution: Use UEL Expressions to get the values of the selected record.
- JavaScript Functions: Use JavaScript expressions to get the values of the selected record.
In the context menu, an order of actions can be set and icons can be added to each action. The action is only shown if its evaluation condition returns 'true'.
Clicking "Action" brings up a model window with messages and/or form fields. When the user accepts the form, a statement or JavaScript function will be executed.
2.1 Physical Model
2.1.1 Main Object
wic_jrep_box_celldata_action | |
---|---|
Label | Description |
Menu ID | |
Box ID | Box identifier |
Action Id | Action Identifier |
Order | |
Activation condition | If condition is true, menu will be activated
|
Label | Label to show in menu |
Icon | Icon to display in menu |
Confirm | Indicates if confirmation is needed before the Execute Action button
|
Type | Type of execution
|
Size form |
|
SQL / XSQL statement / JavaScript | SQL / XSQL statement or JavaScript
|
Created by |
|
Date created |
|
Modified by |
|
Date updated |
|
Actions | ||
---|---|---|
Button | Title | Notes |
ACTION_RENUMERAR | Renumber | Renumerate buttons with a gap of 2 positions |
2.1.2 Fields
3 Implementation
The following sections describe how to create various actions.
3.1 Javascript Functions
The user must open their dictionary application and go to the form object where they want to add an action. Next, these steps must be followed:
- Enter SQL BOX which allows actions
- Enter the Action tab and add a new record with the following values:
- Type: Javascript.
- Order: 1
- Tag: TEST_ACTION_JS
- Confirm: 1
- Icon: 0
- Activation Expression: 1==1
- Javascript:

3.2 Execute Function
The user must open their dictionary application and go to the form object where they want to add an action. Next, these steps must be followed:
- Enter SQL BOX which allows actions
- Enter the Action tab and add a new record with the following values:
- Type: Execute
- Order: 1
- Tag: TEST_ACTION_EXECUTION
- Confirm: 1
- Icon: 0
- Activation Expression: 1==1
- Statement Execution:

3.3 Execute Function with Form
The user must open their dictionary application and go to the form object where they want to add an action. Next, these steps must be followed:
- Enter SQL BOX which allows actions
- Enter the Action tab and add a new record with the following values:
- Type: Execute
- Order: 1
- Tag: TEST_ACTION_EXECUTION
- Confirm: 1
- Icon: 0
- Activation Expression: 1==1
- Statement Execution:

- Add box relationships field (an SQL table box). Add a new record:
- Position: 2
- Tab name: virtual
- Column name: TEST_FIELD
- Size: 10
- Type: Char
- Is input?: true
4 Box Supports Actions
The boxes which supports actions are next:
- SQL-TABLE
- SQL-TREE
5 To Do
ACTIONS will soon offer new features for a wider set of functionalities and options, which are summarized below:
- Add referenced values
6 Appendix
6.1 Use of JavaScript Record Columns on Evaluation Condition
For the evaluation condition, a column name can be used as a JavaScript variable. If the result returned is a variable with name ID, it can be used as seen below:

6.2 Use Record Columns on Statement-Type Actions
For actions associated with XSQL statements, column names can be used as UEL Expressions. If the result returned is a variable with name ID, it can be used as seen below:

6.3 Use Record Columns on JavaScript-Type Actions
For actions associated with JavaScript, column names can be used as JavaScript variables. If the result returned is a variable with name ID, it can be used as seen below:

6.4 Use Action Form Fields on Actions (Statement or JavaScript)
For actions associated with JavaScript functions or XSQL statements, field form actions can be used with the ? character. The fields' order is important in order to correctly replace each ? character. The first field value replaces the first ? character found, the second field replaces the second ? character found, and so on.
