- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 05:20 AM
Hello, I have added an 'Active' field to the locations table (cmn_location). I would like to only display active locations on any table. If I select a location from any table, I would only like to see active locations
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 05:53 AM
yes that's correct.
But since you mentioned this should happen in every table which has location field, better to use Query business rule on cmn_location table as per what I shared above.
With this you need not worry on updating reference qualifiers on those many fields
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
04-01-2025 08:36 AM - edited 04-01-2025 08:37 AM
navigate to task.do and set the ref qual for the location field to active=true
navigate to sys_user and set the ref qual for the location field to active=true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 05:24 AM
Hi @DreDay3000
Then, you need to create a dictionary override on all relevant tables. For example, in the user table, we have the location field. You should add the reference qualifier where the location is active = true.
Alternatively, you can add the field to the task table and set the reference qualifier filter there. This will ensure that any table extending from the task table will use the location field and only show active locations.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 05:26 AM - edited 04-01-2025 05:32 AM
Hi @DreDay3000
You can create one Read ACL on the cmn_location table wih condition, active = false and the required role should be admin.
So that, the inactive loactions will be visible only to admins not for other users. OR you can use query business rule.
For more info, you can review the below community post.
https://www.servicenow.com/community/developer-forum/global-reference-qualifier/m-p/2616150
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 05:28 AM
HI @DreDay3000 ,
Wherever you are using this location table as reference, you can set the conditions in the reference qualifier as below:
https://www.servicenow.com/community/itsm-forum/reference-qualifier-for-active-records/td-p/530553
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 05:33 AM
So you added field on Location table
Since you want to show only active locations from any table's field then you can create query business rule on cmn_location table
Something like this
BR Condition:
gs.getSession().isInteractive()
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.addQuery('u_active', true);
})(current, previous);
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