Add variables dynamically on catalog form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2016 03:02 AM
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
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2016 03:45 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2016 05:24 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2018 05:24 AM
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