Introduction
When a server error validates to true, the system displays exactly the text of its configured message. However, it is possible to associate the rule and the message with a parameter to customize the message with the specific invalid data the user has attempted to save.
For example, a server error without any formatting might display the message, "Date of Birth cannot be a future date." But a formatted error could specify the actual date the user entered, as follows: "Date of Birth, 01/01/2050, cannot be a future date". Formatting the server error in this way can make it easier for the user to understand why their data is invalid and how to edit it.
Prerequisites
The query required to be used for the expression must already exist.
|
Quick Steps |
| 1 |
Search for and open the entity |
| 2 |
Open the Conditions section, then open the Expression section |
| 3 |
Enter the Message Description |
| 4 |
Enter the Parameter |
| 5 |
Open the Constraints section |
| 6 |
Add the constraint |
| 7 |
Save the entity |
Detailed Steps
Step 1. Search for and open the entity.
The form's entity is where you configure its validations, including server error rules.
Step 2. Open the Conditions section, then open the Expression section.
The expression must exist before beginning this process. If you have not already created the expression, you will need to do so.
The expression uses this query. You will have to create the query if it doesn’t already exist.
Step 3. Enter the Message Description.
The application will display whatever text you enter. The placeholder for the parameter is {0}.
Step 4. Enter the Parameter.
This is the control whose input you want to plug into the {0} placeholder whenever the system displays the message. In this case, that's the Date of Birth field.
Step 5. Open the Constraints section.
Step 6. Add the constraint.
Add the expression as a server constraint.
Step 7. Save the entity.
Click the Save icon to save the entity.
Then, run the Preview on the form with the parameter. Xelence displays the form output. You can test your updated settings.
When you have previewed your form, it should look something like this. If you try to save invalid data, the error displays your entry in the error message.
This post is part of the Maintenance Form topic. Click here to open the Maintenance Form Overview.
This post is also part of the Entity Form topic: Click here to open the Entity Overview
#Xelence
#Forms
#Entity