How can admin override a business rule?

Smith Johnson
Tera Guru

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. 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

8 REPLIES 8

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

@Ashutosh Munot Thanks for your answer,

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?

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

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

GlideSession

GlideSystem method isInteractive() always returns 'false' when logged in using Mobile app.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader