The variable must first be defined in either the Global Options | Definitions or at the Profile | Definitions tab in order to be used as validation logic in a particular element.
$slADCurrentUser = GetObject($LDAP)
If not @error
$adMobile = $slADCurrentUser.mobile
After the variable has been defined an element can be created using the values below. In Validation Logic window, double-click to create a new entry. When the ‘Edit Validation Logic Rule’ window opens expand Custom Validation and click Custom Function and enter one of the following values:
("$ADMobile"=>"1") If the field has a number
("$ADMobile"<"1") If the field is empty
NOTE: If the number begins with a “0” then the “<1 or =>1” functions will not work. In these cases an additional Variable must be defined.
Create a new variable to use the first number that is not a zero.
The “,3,2” in this definition is “,StartingNumber,HowManyCharatersToRead”
In our example of “0031456852456” will now return “31” when using the $ADMobileSub that was defined. For further clarification if the number was “0055456825793” then the returned value would be “55”.
The numbers used can be changed to what is needed. Using $ADMobileSub=SUBSTR($ADMobile,4,5) on number “0031456852456” will return “45685”.
Now that the number returned does not begin with zero the “<1” function will work.
("$ADMobileSub"=>"1") If the field has a number