Business rule is not running for users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2017 11:49 PM
Hi All,
I have written a business rule, for triggering an notification as below,
But its not working for the end users. But its working for the admin. What could be the issue?
(function(){
var gr = new GlideAggregate('x_isgi_isg_governa_pm_slasum');
gr.addEncodedQuery('sla_id.slt_id.master_contract_id.sup_id.supplier=TCS^serv_monONLast month@javascript:gs.beginningOfLastMonth()@javascript:gs.endOfLastMonth()');
gr.addAggregate('COUNT','sla_id.slt_id.master_contract_id.sup_id.supplier');
gr.setGroup(false);
gr.query();
while(gr.next()){
var gr1 = gr.getAggregate('COUNT','sla_id.slt_id.master_contract_id.sup_id.supplier');
gs.addInfoMessage(gr1 + 'GlideAgrregate Count');
var gr2 = new GlideRecord('x_isgi_isg_governa_pm_slasum');
gr2.addEncodedQuery('sla_id.slt_id.master_contract_id.sup_id.supplier=TCS^serv_monONLast month@javascript:gs.beginningOfLastMonth()@javascript:gs.endOfLastMonth()^s_wf=6');
gr2.query();
if (gr1 == gr2.getRowCount()){
gs.addInfoMessage('full');
gs.eventQueue("x_isgi_isg_governa.TC submission full",current);
}
else if(gr2.getRowCount() > 0 && (gr2.getRowCount() > gr1*0.50 && gr2.getRowCount() < gr1*0.52) ){
gs.eventQueue("x_isgi_isg_governa.TC submission par",current);
gs.addInfoMessage(gr2.getRowCount() + " getrow count");
}
}
})();
User has all rights. My custom table is extended to Task table..Is there any issue with the code. Why for end users its not triggering notification and only working with admin id
Thanks,
Malaisamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 12:08 AM
he most probable answer would be ACL on the table..
Try to execute the code as an admin (use gs.log.. for debugging), if its working as an Admin then its access right issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 12:20 AM
Hi Shiladitya,
Thanks for the response.
Yes as an admin this is working .. I am able to see the log and emails as well properly..
But when i do the same thing with end users id i am not getting any log.. But user has all read write and create access.
do i need to give access to task table also because i have extended to task table?
Thanks,
Malaisamy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 12:35 AM
Try using Debug Business Rules and Debug Business Rules(details).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 12:39 AM
So its ACL, have you created any user roles for the table in question, check ACL and see if theres any ACL? roles fot this table. If yes ? delete/inactive them