- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 02:41 PM
I have 2 fields one is Geo (choice) field and another is location(reference) field . In my location field i have over rided the reference qualifier and kept 3 locations India, Philippines, Mexico . Now in geo field i have two options NA and APAC . Now I need a functionality such that if I select NA in the geo field the search box in the location field should have only Mexico as location to select similarly if i select APAC only India and Philippines should be visible to select . How can I achieve this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 04:38 PM - edited ‎09-23-2024 06:59 AM
You should be able to do this all within the reference qualifier like this:
var ret='sys_idIN';if(current.u_geo == 'NA'){ret += 'sys_id of Mexico';}else{ret += 'sys_id of India, sys_id of Philippines';}ret;
Where u_geo is the choice field name, which has the actual value of 'NA',
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 03:00 PM
@kiran kumar m1 You can implement advanced reference qualifier. Please refer this
https://servicenowguru.com/script-includes-scripting/advanced-reference-qualifier-script-include/
Please mark my answer correct and helpful if this works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 04:38 PM - edited ‎09-23-2024 06:59 AM
You should be able to do this all within the reference qualifier like this:
var ret='sys_idIN';if(current.u_geo == 'NA'){ret += 'sys_id of Mexico';}else{ret += 'sys_id of India, sys_id of Philippines';}ret;
Where u_geo is the choice field name, which has the actual value of 'NA',
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2024 06:46 AM
Hi @Brad Bowman , thanks for your quick reply. Actually this is for a custom application , earlier I have dictionary overrided the location field and hardcoded the 3 locations sys ids . Now I have removed that and pasted your reference qualifier ,but its showing all the locations instead of those three .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2024 06:56 AM
When you see all of the records, something in the qualifier is invalid or it otherwise doesn't resolve correctly. In this case it looks like you have a semi-colon instead of a colon after javascript, and remove the << >> - I was just using those symbols to try to call attention to what needed to be replaced. I also transposed the { } brackets. I corrected this in the earlier response.