Business rule is not running for users

malaisamyj
Tera Contributor

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

6 REPLIES 6

adityaghosh
Tera Guru

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.


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


Try using Debug Business Rules and Debug Business Rules(details).


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