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

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

You dont want the BR to run for admin then in condition field under advance section write this line

!gs.hasRole('admin')

So this will not run for admin users.

 

Thanks,
Ashutosh

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

if this is for query business rule then add this in the condition

!gs.hasRole('admin')

Regards
Ankur

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

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

@Ankur Bawiskar Hey Ankur,

thanks for your reply.

Could you please give me a simple example, to understand the importance of gs.getSession().isInteractive() condition?

The condition: !gs.hasRole('admin') is clear to me, but I cannot understand why should I need the other one.