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

Please provide the code if possible .



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


Thanks,
Deepa


Tadz
Tera Guru
Tera Guru

Hi Deepa and Basha,



I mean I want the user without admin role can still execute the BR fully.



I have 2 BR that is conflicting w/ each other before query and the after update/insert.


The before query:


        it has a code of:


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


                            //some codes here that if its admin it will execute the code.


                  }



The after update/insert.


        it has a gliderecord:


                  var gr = new GlideRecord('custom_table');


                            gr.query();


                            if(gr.next()){


                                      gr.custom_field = current.field.


                                      gr.update();


                            }


                         


PS. They are on the same table.


Thanks,


Tadz


Hi Tad


Have you checked the syntax of code. Check if that is correct because in you second code you have put - gr.custom_field = current.field. it should be terminated by string.It will be better if you can provide both business rules.



-Harsh




If you every user can execute then you have to remove     if(gs.hasRole('admin')) line from before BR.



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


Thanks,
Deepa


dalton1
Giga Expert

Hi tadz,



If you want to execute both of the business rules without requiring the user to have admin access, place your code outside the if(gs.hasRole('admin')){} or remove that checking entirely. Kindly mark this thread if Answered or mark any answer/s you find helpful.



Many thanks.



Dalton