Reference Qualifier reverts to simple after Save
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 03:23 AM
Hi,
I have added a script into the Reference Qual field after changing the Reference Qualifier to Advanced:
But after saving, it reverts to Simple:
Will this affect how it runs? Will it not run the script because it's showing as Simple or will it run anyway?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 04:04 AM - edited 09-22-2023 04:05 AM
It's reverting because the advanced is invalid. It should start out javascript followed by the colon symbol, not : - that's a lovely replacement 'feature' on this site editor whenever javascript followed by a colon is typed. Reference qualifiers usually do not contain excessive extra spaces/tabs/crs and comments, so that might be throwing it off also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 05:31 AM
Thanks Brad for your insight, it's appreciated. I have done what you suggested and it no longer reverts to simple! However, I am still having issues with the Reference Qualifier not working... Not sure if you can help with that at all? I initially asked the question here: https://www.servicenow.com/community/developer-forum/set-dynamic-filter-on-reference-field-lookup-li...
Many thanks and let me know if you need info at all!
*Updated script:
javascript:
var query;
if(current.getValue("u_affected_service")){
query = "cmdb_ci=" + current.getValue("u_affected_service");
} else {
query = "your cutomized query";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:31 AM
Hi @Brad Bowman
Thanks for this information, it saved a lot of time for me as I was facing this same issue today. However , I have an query related to it.
Where is ServiceNow it is configured? there must be some kind of script which is validating this condition I believe . I tried to look for it , but did not see anything.
If you have the reference , please share. would like to see the backend configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 04:08 AM
try what Brad mentioned and share the status.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader