How to use grid validation in a FOEX application

Grid validation is one of the many cool features that you can use when developing an application with the FOEX Plugin Framework. You can also set up friendly messages for users, so that they become aware of any errors and can take the necessary steps to provide accurate information. 

Here’s a grid validation example from the Forms to FOEX demo that we released a while back. Looking at the Sales Rep tab, we made sure that the name fields are not left empty:

FOEX Grid Validation example 1

FOEX Grid validation example 1

Additionally, we predefined the commission’s percentage value to either none or one of the following: 10, 12.5, 15, 17.5 and 20. Any other value will trigger an error message (as you can see below) and a help message is shown when a user hovers the highlighted cell.

FOEX grid validation example 2

FOEX Grid validation example 2

If you’re wondering how to add the tooltip help text, a good starting point use the following link to understand more about how to display tooltips in your FOEX application. Now, back to our example, here’s how you can set it up:

Defining the FOEX Grid plugin attributes

To setup grid validation is really simple. Go to the Grid Region attributes and input there the procedure created to apply your business rules:

FOEX Grid Region attributes 1
FOEX Grid Region attributes 2

FOEX Grid Region attributes 3

In our example we are validating the First and Last name – which cannot be null, and the values you can be used in the Commission % column – which, as mentioned above, can only be (10, 12.5, 15, 17.5, 20 or a blank cell). If any other value is typed, then an error message is show when the Save button is clicked.

Here is the code for the procedure generated:

FOEX Grid Validation generated procedure code

 

After that, if you set the First/Last name fields to Null and/or Commission % to a value other than the ones predefined, you will get the following error message:

FOEX Grid validation error message

FOEX Grid validation error message

 

A detailed message is provided when you hover the mouse over the highlighted field(s):

First Name cell empty error

First Name empty cell error

 

Commission percentage value error

Commission % wrong value error

 

We wrote this article to show a simple grid validation example that you can use in your FOEX applications.

One final piece of advice: you can have as many conditions as you’d like, checking every field available inside the procedure and returning user friendly messages to your users.

Taking this example one step further, you could easily create a “Processing Procedure Override”, which basically follows the same concept, but enables you to have more complex code when inserting/updating/deleting a record.

 

Do you have a technical question about FOEX or want good tips for improving your application? We’ve launched this series of How To articles to help improve your FOEX applications even more.

Use #askFOEX on Twitter and we’ll get back to you as soon as possible or sign up for a free trial and see why it is a great tool for developing large-scale web applications!

Add your comment

Your email address will not be published. Required fields are marked *