Prerequisite
Prior to creating a codex, it is essential to establish a board since the configured codex scripts can be activated within that Board when specific conditions arise.
To add a new script, follow the below steps:
Navigate to
(settings) >> CodeX >> click Scripts in the menu. Click the New Script button.
- Code the script according to your business requirements.
Provide the following execution details:
Script Name: Enter a name for your server script.
Execution Location: Select the location where the script should run.
Execution Trigger: Specify when the script should be executed.
Board: Choose the board for which the script will be executed.
Click the Publish button and confirm your action. You also have the option to save it as a draft and publish it later by clicking Save as Draft.
A new script will be added to Codex in Qntrl.
An execution trigger can only be used twice for a particular board.
Parameter Configuration Limits
The default JavaScript configuration will be as follows:
config: {
cpu_timeout: 1000
cpu_memory: 50
file_request_count: 10
file_size: 100
http_clientrequest_count: 10
sdk_call_count: 100
logger_level: "INFO"
execution_timeout: 30000
execution_log_limit: 30000
}
Units for the a above are in 'ms' and 'MB'.

Advanced Options (Enterprise Only)
Advanced Options are available exclusively to enterprise customers and are enabled on request. These options allow enterprise users to fine-tune deployment behavior by configuring the following thresholds.
If you're not an enterprise user, your deployments will adhere to the default system limits.
Parameter Name | Description | Range/Allowed Values |
Cpu Time (ms) | Maximum CPU time allocated for the function's execution | 100 - 240000 |
Memory (MB) | Memory limit allocated for the function's execution | 5 - 4000 |
File Request Count | Number of files that can be created | 1 - 2000 |
Maximum File size (MB) | Maximum size per file | 1 - 8000 |
HTTP Client Request Count | Number of external HTTP requests allowed | 1 - 8000 |
SDK Call Count | Number of internal SDK calls allowed | 1 - 8000 |
Execution Timeout (ms) | Maximum time allocated for the function's execution | 500 - 3600000 |
Execution Log Limit | Maximum number of character logs to be stored in zlogs | 3000 - 20,00,000 characters |
Logger Level | Logging level of the function | FATAL, ERROR, WARN, INFO, DEBUG, TRACE |
Managing CodeX Scripts
Edit a Script
To make changes to a script in CodeX, follow these steps:
Navigate to
(settings) >> CodeX >> click Scripts in the menu. Select the codex script you wish to edit.
Make the necessary modifications.
Click the Publish button and confirm your changes.
The codex script will be updated.
Publish your scripts so that the updated versions can be executed effectively.
Set Execution Order for CodeX Scripts
You can decide the order in which the codex gets executed. To set the execution order:
Navigate to
(settings) >> CodeX >> select Scripts in the menu.
Click the Set Execution Order button at the top right of the page.

Choose a Form for script execution and select the Execution Trigger for when it should be activated.
A list of scripts will be displayed based on your selections.
In the EXECUTION ORDER section arrange the scripts in the desired execution order.
Click Save.
The scripts will be executed according to the order set.
Filter Scripts
You can filter codex to categorize them based on forms. To filter the codex for a specific form:
Navigate to
(settings) >> CodeX >> select Scripts in the menu. Click on
in the All Forms column and select a form from the displayed list.
Scripts of that particular form will be displayed.
Enable or Disable Scripts
All the published codex scripts are enabled by default. Disabling a server script will temporarily stop its execution.
1. Navigate to
(settings) >> CodeX >> select Scripts in the menu. 2. Under the Active column, toggle the button next to a server script to activate or deactivate the script.
Delete a Script
To delete a codex script:
1. Navigate to
(settings) >> CodeX >> select Scripts in the menu. 2. Hover over the name of the script you want to delete, click mouse over action menu,
, and select Delete. 3. Confirm your delete action.

Triggering Script Execution: Locations and Triggers
CodeX scripts can be activated from various modules within Qntrl. The functionality and behavior of the scripts vary depending on the module.
Below are the supported modules where CodeX scripts can be executed, along with their available triggers:
Cards
On Load - This script runs when a form is first loaded in the Qntrl system as part of the page rendering process. It can be used to initialize variables, retrieve data, set default values, or apply dynamic behaviour to the user interface.
Before Create - Script runs just before a new record is created. It allows developers to validate input data, set default values, or run custom logic before the record is officially added to the system.
After Create - Executed after a new record is successfully created, this trigger is used for post-creation tasks like sending notifications, updating related records, or executing additional logic.
Before Update - This trigger runs before an existing record is updated. Developers can use it to validate or manipulate data before the changes are applied.
After Update - The script is triggered after a record is updated, allowing developers to perform actions or updates that should follow the modification of the record.
Before Delete - Script runs just before a record is deleted from the Ql system. It can be used for validation, cascading deletions, or any necessary logic before the record is permanently removed.
After Delete - Executed after a record is successfully deleted, this trigger is used to perform post-deletion tasks such as updating related records, logging events, or running any required custom logic.
Email In
When an email is sent to Qntrl, a new card is automatically created. By adding codex scripts you can customize this process by assigning values to custom fields, creating sub-cards, etc during card creation. These scripts analyze incoming email data and execute actions upon card creation.
Transition
CodeX scripts can be triggered at different stages of a transition process:
- Before Transition: Executed just before the transition starts.
- During Transition: Runs while the transition is in progress.
- After Transition: Triggered once the transition has completed.
Circuits
CodeX scripts can be executed through functions defined in the system.
Scheduler
Scripts can also be triggered based on scheduled tasks, allowing for automated execution at predefined intervals.
Related Articles
Parameters in CodeX Script
In the CodeX script, you can perform CRUD (Create, Read, Update, Delete) operations on the Parameters in Qntrl through the SDK. Instead of defining a URL or other values directly in your CodeX script, you can define them in ConfigStore and reference ...
Script Modules
Early Access Script module is not enabled for all users. If you’d like to try it out, please email our support team for early access. Script Modules offers creating reusable, ready-made templates for your business logic compatible with ES6 modules. ...
Custom Function: Create_Job
This custom function can be used to create a new card in any board. It can also be configured to carry forward necessary field values from the former card to the latter. Business Scenario Helen is the head of Procurement Management in her ...
Step 1: Create Form
Forms are used to capture requests from users that help you collect the data required to kickstart workflows and perform tasks in Qntrl. There are different departments in an organization providing different solutions. For instance, the finance team ...
Summary
Overview CodeX, a robust scripting feature within the Qntrl platform, empowers you to automate tasks, manipulate data, and integrate workflows/applications. By running JavaScript code in a standalone server environment, CodeX allows you to execute ...