Changing the display value of checkbox variable based on different catalog items.

Aasrita
Tera Contributor

Hello All,

 

I have a checkbox variable in a variable set that was used by three catalog items. Can we change the display value(name of the variable) of the variable in three different catalog items using any client scripts or we should create duplicate variables?

3 REPLIES 3

Sandeep Raj Ram
Tera Contributor

Hi @Aasrita ,

 

As the variable is in variable set and used by 3 catalog items, you will have to create duplicates.

 

Regards,

Sandeep Raj

Mark Manders
Mega Patron

The purpose of a variable set is that you can use the same variable(s) in different catalog items. When you want a different variable (even if it's referencing to the same table, with the same conditions), you shouldn't use a variable set.

Of course all kind of manipulation can be done to change this, but why? It will never be as performant because you will be loading scripts on load of the page. Just create the variable for those 3 items (we're not talking about changing hundreds of records).


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

piyushsain
Tera Guru
Tera Guru

Hi @Aasrita 

Yes you can change the Label of the variable by using g_form.setLabel('field_name','new_label'). But you need to remeber that this would be a client side change and the original label on server side will always be the same, but you should also note that in Reports or other areas like list editor it will always show the original name

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain