- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2020 11:38 PM
Hello all,
I try to use g_form.addOption() for a reference field, but this does not seem to work.
I have a reference field ("type") on portal. This field refers to cmdb_ci_appl table. Based on the role of the user, I want to add some more options to this field.
Any assistance on this would be so valuable for me.
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2020 11:42 PM
You cannot use g_form.addOption on reference field.
You have to add options/records to the table that is referenced and set up a reference qualifier if you want to limit the records that are shown accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2020 11:42 PM
You cannot use g_form.addOption on reference field.
You have to add options/records to the table that is referenced and set up a reference qualifier if you want to limit the records that are shown accordingly.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2020 11:44 PM
Hi,
You can restrict or show values based on a reference qualifier. Details below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2020 11:59 PM
Hi Smith,
As already suggested you should use reference qualifier on your field to restrict the values to be shown.
refer below link for help
Advanced Reference Qualifier Using a Script Include
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader