SetVar

All validation programs

Sets a BusinessRules.Variable to the contents of the current element or to a passed value. See Appendix A: Variables for an overview of variables.

Format of Parameters

VarName  VarValue

Where:

VarName  Name you are assigning to that variable. If the variable exists, the current contents are overwritten with VarValue. The name can be any length, with no special characters or spaces. It is case-sensitive.
VarValue Optional. Value being assigned to that variable. This can be another variable, Current_Element, a literal in double quotes, or Current_Date if appropriate. If VarValue is omitted, the value in Current_Element is assumed.

Example. This example assigns the variable name 2010AAN402State to the contents of the current element.

The variable 2010AAN402State can then be used in the parameter for a rule like the one shown below, which checks the zip code in the current element to see if it is valid for the state that is in the variable 2010AAN402State.