Skip to content

Client Validations

Client validations give immediate feedback to the user that something which was typed in is incorrect. Traditionally this was done when the user saved a record but then the user is burdened with getting the input for a record correct at the outset and eventually having to deal with all the non-specific error messages the server provides with little to no context of the message. When it comes to user experience, this is not great.

The solution is to add client validations to the IFS Aurena projection model. Client validations are great for quick sanity checks, for example to check if the end date that was entered for a record is actually after the start date, to check if a quantity is non-negative, for email and phone number validations etc. Basically these validations can be used to perform simple validations that could help the user enter the correct information. Note: Client validations are not a replacement for complex whole record validations. Complex validations are still required and must be done on the server code.

Client validations are defined on the record level, thus the syntax appears on the projection as mentioned previously and they work on all text fields. Listed below are a few examples of how client validations look like:


//Example 1  
//---------  
attribute Quantity Number {  
      validate [Quantity >= 0] message "Quantity is invalid, must be greater than zero";  
}  

//Example 2  
//---------  
attribute Quantity StartDate {  
      validate [StartDate < EndDate] message "Invalid Start date, should be before End date";  
}  

//Example 3  
//---------  
attribute Quantity Number {  
      validate [Quantity >= 0] message "Quantity is invalid, must be greater than zero";  
}  

//Example 4  
//---------  
attribute Quantity StartDate {  
      validate [StartDate < EndDate] message "Invalid Start date, should be before End date";  
}  

Example Code - Client Validations

Client Validation Example

Figure 1 - Client Validation Example in action

Client Validations in IFS Aurena vs. previous IFS Clients

The concept of client validations is nothing new, IFS Cloud have had it for a long time, however, the user interface that was available for the client validations in the past was not the most user friendly. Keeping with the theme of user experience in IFS Aurena, the client validation framework was revamped to give a more standout, visually pleasing appearance, which is also touch friendly.

A word of caution

When working with IFS Aurena pages, client validations might seem like the miracle pill - it is not. Ultimately, the server is responsible for the data it accepts, and client validations should only be used as a form of end user convenience that complements server-side validations and should not be used to maintain all data correctness.