How to access a variable inside a variable set using Client script ?

DD18
Kilo Explorer

I am trying to access a variable of a variable set using an On_change client script but not sure about the steps.

Var set name : on_behalf_of

Var name : caller_id - which refers to a table user_info

Tried using - var clrID = g_form.getValue('variables.caller_id'); but I could see an empty alert box when I try to print clrID . Attached the same for reference. Any idea would be useful.

Thanks in advance.

7 REPLIES 7

Namrata Khabale
Giga Guru

Hello DD,

 When using an onChange() catalog client script, it is linked to a particular variable instead of a field. Use the following syntax to obtain the value of a catalog variable. Note that the variable must have a name. Replace variable_name with the name of the variable.

g_form.getValue('variable_name');


If my answer helps you Mark it as Helpful and Correct.

Thanks,
Namrata Khabale.

Sumit Suthar
Mega Expert

Hey,DD

To access a variable of a variable set using an On_change catalog client script you can use the variable name.

g_form.getValue('varible_name');

for example:

var clrID = g_form.getValue('caller_id');

alert(clrID);

Indrajit
Mega Guru

Hey DD,

try this below code,

var clrID = g_form.getValue('caller_id');

alert(clrID);

it will show you the caller id value in alert box.

Please Mark Correct and Helpful if it is useful.

Regards,

Indrajit.