- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 06:22 PM
Hi Community,
I was trying to hide an option in a reference field based on the selection on another field but I can't seem to make it work. I have seen a couple of similar question here in community but the solution that works for them does not seem to work when I tried it.
Requirement:
When country = Singapore, category shoould show Recruitment, all other countries should not show the Recruitment category.
My script Include:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 08:37 PM
Hi @Ramel
Ok lets do vice-versa...have a try once.
javascript:
var query;
if (current.variables.u_country != 'SINGAPORE'){
query = "u_available_forISNOTEMPTY^u_name!=Recruitment/Onboarding";
}
else {
query = "u_available_forISNOTEMPTY";
}
I have checked in my PDI its working as expected....!!
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 08:47 PM
This worked. I have also tried the below with script include and it worked. But since your sueggestion does not need scipt include, I will go with that. Appreciate your help. Thanks a lot.