Business Rule to run with admin access

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 11:34 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 11:38 PM
Hello,
Keep line of code inside the condtion which check the person who is logged in is Admin.
if(gs.hasRole("admin))
{
//Keep the code here
}
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 11:39 PM
Hi ,
It may be that there would some condition in the BR to check role. Can you provide BR code so that i can take a look.
You can put if( gs.hasRole('admin')) in the beginning to check this.
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
Thanks,
Deepa

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 11:41 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 11:43 PM
As i have told you, keep the code inside the condition. so it should not execute for the users who are not Admin..