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:47 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 11:59 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-04-2016 12:03 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 12:03 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 01:51 AM
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