Adding Server-side Validation
Â
Sample code:
Display file source:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PUISAMPLES/QDDSSRC(CUSTINQ3D)
RPGLE source:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PUISAMPLES/QRPGLESRC(CUSTINQ3R)
To add server-side validation, select the error messages property of the screen, and click the prompt button.
The Error Messages dialog will appear. Using the Add button on the right side of the dialog, you can add as many server side error messages as needed.
Â
The message can be specified in plain text, or an IBM i message file can be used to retrieve the message. You can bind any attribute of the message to an RPG variable. In addition, you should specify an Error Condition Indicator or Expression to define how the message is to be triggered. Next, add the appropriate RPG code to trigger the indicator.
When the user enters an invalid customer number, the following will appear:
Correcting the textbox to a valid customer number value, removes the error message:
Note: Server-side error messages can be assigned to specific widget elements or at the screen level.
Â