Format Control validation lng($variable)
In SD i'm using a validation that is
then messge is "Extension length shoulb have minimum 7 digits"
previously it was working but now it's showing message on both condition lessthan or morethan 7 digits.
I also used lng($G.extension) <7 but there is same behaviour like above case.
While that form is open, run rad debugger and display the global var.
See what value you are getting. I'm surprised you are using global variable and not the field on the form. Global variable can be changed anywhere. Something like phone.number in $file is specific to the form on the screen.
Which is why the length function is failing. You cannot get length from a null value. Why don't you do a display on the phone number field. e.g d phone.number in $file. I am not sure what is the real field name.
If you get a non null value and its display the correct phone extension number, you can use that instead of $G.extension. It may be easier than trying to find why the code that populate $G.extension or $extension is no longer working.
As you are setting the cursor position to the "extension" field then I suppose you are willing to check the value entered in that field. In this case the condition should look like this:
lng(extension in $file)<7
But in addition if this is a mandatory field in your system then I'd insert one more validation before checking the length of the value:
not (null(extension in $file))
If you still need the varaible's value - simply replace the "extension in $file" with the variable's name.