Filter the values in reference qualifiers in custom HTML UI page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello everyone.
I have a custom UI page which is called through UI Action. The UI page has a couple of reference qualifiers. One of the reference qualifier is Account. Based on the selected account the values in other reference qualifiers should be filtered out. How to achieve this requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
So you have 2 or more reference fields on UI page and based on 1st you want to filter 2nd or 3rd reference field?
If yes then check this where I shared solution on how to handle this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Ankur.
Unfortunately, the above solution didn't work. Here's my code snippet.
HTML Section:
Please tell me if this needs any correction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
It worked fine for me in the link I shared 8 years ago and have worked fine recently.
seems you have not updated your script as per the logic I shared.
Compare both and make the necessary changes and it should work fine.
HTML Mistake
<g:ui_reference name="account" id="account" table="customer_account" completer ="AJAXTableCompleter" query="active=true" onchange="getContact()"/>
-> 1 mistake is here -> you forgot to add this highlighted in bold
var contactnames = gel('lookup.contact').value;
-> 1 more here -> the table should be customer_contact and not location
contactnames.setAttribute('onclick',"mousePositionSave(event); reflistOpen( 'contact', 'not', 'customer_contact', '', 'false','QUERY:active=true', 'sys_idIN" + contactArray+ "', '')");
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Ankur, I have made the changes and still I am unable to filter out the contacts.
Please find the updated code below.
HTML Section: