on 11-24-2009 3:01 PM
I have an issue with validating complex data entered in VC screens.
A customer needs to enter a reference that must (for example) be in the format "DExxxxxx" where x is a number. Obviously we can validate the starting two letters and the length, but as far as we can see there is no way of checking whether what is entered in the last 6 spaces is numeric or alphabet and therefore the user could have entered DERAFJTY rather than the required 6 numbers.
Is there a way of validating this type of entry within VC?
Hi Emily,
You can convert the last 6 characters to a number and check the result using NVAL. In case NVAL gets a string representing 0 or a non-numeric value, it will return null (which can be checked with ISNULL).
You can use the following dynamic expression (for example, if your input field is stored in store@TXT1):
ISNULL(NVAL(RIGHT(store@TXT1,LEN(store@TXT1)-2)))&&(RIGHT(store@TXT1,LEN(store@TXT1)-2)!="000000")
The rest of the conditions (string length and the first 2 letters) can be checked as usual.
Best regards,
Tal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.