In GAPTEQ, various workflows can be mapped directly in the application using JavaScript. This allows you to create your own action lists and link them or individual actions from them to conditions in order to trigger flexible sequences.
In this article you will read the following content:
Create action list in the script parts
Execute the created script parts
1. Create action list in the script parts
You write your action list in the “Script parts” of the page. It can be defined and executed in each individual page when the page is called up. The “Script parts” can be found in the “Page definition” menu.
- You can create new code via “Add script part”. Assign a meaningful name - e.g. “Action list: Create inventory”.
You can use all actions of the components of this page for your list. The syntax is identical to the classic way in which you select “Add Action” → Components are listed.
Tip! The script part “page.loaded” is included on every page and cannot be deleted.
Attention! Actions that have been specified in GAPTEQ in the classic way are executed in sequence. To ensure that your self-written action lists behave in the same way, each GAPTEQ action must be preceded by the “await” command
Example: await grid1.reload()
2. Define conditions for actions
Note! You define conditions for your desired actions with simple IF/ELSE or CASE queries.
Example:
The mail sender should only be executed if the checkbox component with the ID “checkSendMail” is ticked:
Cancel script part
You can simply stop the execution of the action list controlled by conditions with a return false;. Subsequent actions will no longer be executed.
Example:
3. Execute the created script parts
- Under “Add Action”, click on “Scripts” and select the script part to be executed.