Add variables dynamically on catalog form

lomouhamadou
Kilo Guru

Hi all,

Once again I am requesting help on our wonderful community.

I need to add variables on a form but dynamically.

So, I guess it is doable by using an "add button" option   that will generate the variables (I have to create 4 button every time we press the button) on the form every time we press the button.

Any idea, suggestion on how to handle this.

Thanks in advance for your time and help.

Regs,

Lô Mouhamadou

7 REPLIES 7

lomouhamadou
Kilo Guru

Thanks mates for the answers. I think I will follow the approach on creating them like 10 times and hiding them and showing them when needed.


I wanted to ccreate them dynamically because the amount of variables depends on each user. There is no certain number.


THe dynamic option would allow to create from 1 to xxxxx


akashsrm100
Kilo Guru

var gr= new GlideRecord('item_option_new');


gr.initialise();


for(i=0;i<10;i++)


{


gr.name='hello'+i;


gr.active=true;


gr.category=current.category;


gr.item=current.item;


gr.display='true';


gr.update()


}


you can use this script as a reference for creating variable dynamically more fields you can define as per you requirement.




Mark Correct if it solved your issue or hit Like a


Thanks


Akash


hi akash,

 

this will be fine for static for 10 variables.

but for dynamic i have dynamic variables, so every time i cannot create that many variables. any other approach can u suggest me