I want to perform my own input validation and display a message based on the results
Answer
Please use "Script".
Overview
If you want to perform your input validation in "Script", please implement your input validation and result message display process in $p.events.before_validate of the event firing script.
Operation Procedure
- Please enable the NumA column from the Editor tab.
- Create a new "Script", write the script's contents below, and check "Edit" for the output destination to update.
- Create a new record, enter a blank or a value other than 100 in NumA on the editing screen, and press the "Update" button.
Execution Result


Code Samples
| JavaScript |
|---|
| $p.events.before_validate_Update = function (args) {
var myNumA = $p.getControl('NumA').val()
if (myNumA == "") {
$p.clearMessage();
$p.setMessage('#Message', JSON.stringify({
Css: 'alert-warning',
Text: 'No value entered. Please enter a numerical value.'
}));
return false; // If false, processing stops and no update occurs
} else if (myNumA != 100) {
$p.clearMessage();
$p.setMessage('#Message', JSON.stringify({
Css: 'alert-error',
Text: 'Please enter the numerical value 100.'
}));
return false; // If false, processing stops and no update occurs
} else {
return true; // If true, the record is updated
}
}
|