How to add choices to Lookup Select Box via script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2016 09:47 PM
I need to set up values dynamically for lookup select box. Tried the below one, it did not work. I am sure it has to be something else. Need help.
g_form.addOption('select_form', catitem.sys_id, catitem.name);
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2016 09:51 PM
Lookup select picks the value from a table to show on the form. Why don't you add the records permanently to the underlying table instead of adding it on the form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2016 11:12 PM
It should work.
Can you try hardcoding and see
g_form.addOption('select_form', 'catitem.sys_id', 'catitem.name');
Thanks
Srinivas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2016 06:30 AM
Yes, no need to use this g_form.addOption('select_form', catitem.sys_id, catitem.name);
I have a parent field(reference), when I assign a value dynamically to this, it populated the dependent on in the lookup select box.
Thanks Kalai, for the hint.