- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 01:09 AM
Hello all,
I am wondering how can an admin user override a business rule?
What do I need to configure in my BR?
Regards,
Smith.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 01:13 AM
Hi,
for query business rule we usually add these 2 conditions
1) so that it doesn't run for admin as admin can see all data; depends on company process
2) this BR doesn't run when GlideRecord query is performed on this table
BR Condition:
gs.getSession().isInteractive() && !gs.hasRole('admin')
gs.getSession().isInteractive() -> this BR will only run when working in interactive session i.e. UI etc
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 01:28 AM
Hi,
That means the user should be logged in and on the form.
https://hi.service-now.com/kb_view.do?sysparm_article=KB0719429
Check this and it is explained there.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 01:32 AM
in the link that you sent me, it is mentioned that the gs.getSession().isInteractive() will return false if the user uses the mobile application. In this way, the business rule is not going to run.
Am I right?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 01:55 AM
Yes.
THE BR will only run if the action is happening on the form and if the user is logged in and now via any other means.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 02:03 AM
Hi Smith,
simple example
1) consider you have a catalog item and there is 1 variable which refers to your custom table
2) in workflow run script you must be having activity of querying the custom table
3) the workflow might be running in the session of approval user
4) if you don't add that condition then the query business rule will run and that approval user won't be able to have GlideRecord to that table
5) this might give inconsistent behavior
refer links below for help
GlideSystem method isInteractive() always returns 'false' when logged in using Mobile app.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader