Need to get all options from a field (lookup selectbox) on load of form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 09:41 PM
Hello
I have a field(lookup select box) which is referred to topic category table. i have reference qualifier which will bring categories based on some logic. we are showing only unique categories here. Is there anyway i can get all options of the field on load of form. I tried getoption method but looks like it will not work in portal.
Thanks
Akash
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:21 PM
Hi,
no other way other than Ajax
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:12 PM
Hello Ankur
Is it possible to set value of "lookup select box" with category name instead sysid. I tried by sending category name through url parameter. But looks like "lookup selectbox" expecting sysid so i am not able to populate category.
Thanks
Akash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 09:56 PM
Hi Akash,
If you need all those filtered records on load of the form then you could write Display BR and use the filter same as that of reference qualifier. You can access all that data in client script by using g_scratchpad object.
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:06 PM
Hi Abhijit
i am using catalog client script. In my scenario when user clicks on content item it will redirect to the form and i need to populate category. i am sending sysid through URL Parameter. but i have same category name in different COES with different sysids.
for example
i am having category ABC in payroll, performance, total reward tables but sys id are different. On load of form it randomly picking up any one of them due to unique checkbox is true. so i am not able to set sysid. if i get all unique options present in that field on load i can compare that with url parameter and i can set.
Thanks
Akash