Scripting Parameter Form
Applies to: Kyvos Reporting
You can define a validation script for a parameter using the OnChange() event. The script is triggered when:
A user types a value for a parameter with Input Type set to EditText.
A value is selected or deselected from a Dropdown, List, or Tree.
A checkbox (Boolean parameter) is selected or deselected.
Script Behavior
The script must return
truefor valid values andfalsefor invalid values.When validation fails, the specified error message will be displayed.
Report generation is blocked until all parameter validations pass.
Access Scope
Scripts defined at the parameter level have read-only access to:
Other report parameters
Global parameters
Parameter objects, even if they are not imported into the report
Advanced Use Cases
Using scripting, you can also dynamically control the behavior of other parameters. For example:
if (paramA.value < 100) {
paramB.setEnabled(false);
return false;
}
return true;
In this case:
If
paramAhas a value less than 100,paramBis disabled.The current parameter fails validation and returns
false.
When any parameter is impacted by the script, the Input Parameter Form (IPF) automatically reloads affected parameters.
Note on Scheduled Reports
For scheduled report executions, the IPF is not shown. As a result:
Validation scripts are executed at the time of task saving, not during report execution.
Ensure valid default or prefilled values for parameters used in schedules.