cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Validation in VC

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

former_member341000
Participant
0 Kudos

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.

Former Member
0 Kudos

Thank you!

Answers (0)