Business Rule to run with admin access

Tadz
Tera Guru
Tera Guru

Hi, is it possible to make Business Rule run as admin always?

Because I experience where the user has no role and the BR is triggered but because the user has no admin access the BR is not completely executed.

Thanks,

Tadz

14 REPLIES 14

Deepa Srivastav
Kilo Sage

Let me know if you need any other clarification on this or mark the answer as correct to close the thread. That way it will help other who have same query in future.
Find correct option in the below link.



Business Rule to run with admin access



Thanks,
Deepa


Tadz
Tera Guru
Tera Guru

Hi Deepa and Dalton,



Yes it would work if I removed the


if(gs.hasRole('admin')){}



but I wan't to keep the BR both.


The before query BR will make non admin users to not see some records.


While the after update/insert will update the same table but cannot update because of the before query BR.



Thats the problem I'm having right now.



any workaround for this?


keep both BR, just remove admin check   I.e only this line if(gs.hasRole('admin')){   from the code..



Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


Thanks,
Deepa


Did that work Tadz , just removing one line?


Pulkesh Haran
ServiceNow Employee
ServiceNow Employee

In side the BR call an event and pass the required param. In Event action copy the code from your BR and do the update operation on records. It will work. 

 

Event run as System admin and not as login user so no issue with ACL.