How to assign value to variable at runtime for which you do not know the name beforehand?

By | October 20, 2015

You may come across the situation, where you want to assign value to variable at runtime for which you do not know the name beforehand.

Sage X3 has a special function to assign value to variable at runtime for which you do not know the name beforehand.

New Stuff: Entry Point to Update Custom Fields of STOJOU (Stock journal) table

Assign: This function assigns value to the variable for which you do not know the name beforehand.

Syntax: Assign name_exp With value_exp

Parameter details:

name_exp: Expression of the Char type which results in the name of a variable. But the variable must be exist at runtime.

value_exp: Any expression that will be compatible for that variable at runtime.

Kindly refer to the below snippet of code for better understanding.

b1

b2

 

Also read:

1. How to differentiate the Local and Variable?
2. How to add months to your date variable in Sage X3 version 7
3. How to determine if a mask variable can be entered or is displayed..?
4. Checking the Type of variable
5. Global Variables in X3