Business rule executing twice

Community Alums
Not applicable

Hi All,

 

One of the BR written on sc_request table executing twice,

BR:

find_real_file.png

Advanced :

 

if (current.operation() != 'insert' && current.comments.changes()) {
gs.eventQueue("sc_request.commented", current, gs.getUserID(), gs.getUserName());
}

if (current.operation() == 'insert') {
gs.eventQueue("sc_request.inserted", current, gs.getUserID(), gs.getUserName());
}

if (current.operation() == 'update') {
gs.eventQueue("sc_request.updated", current, gs.getUserID(), gs.getUserName());
}

if (!current.assigned_to.nil() && current.assigned_to.changes()) {
gs.eventQueue("sc_request.assigned", current, current.assigned_to.getDisplayValue() , previous.assigned_to.getDisplayValue());
}

if (!current.requested_for.nil() && current.requested_for.changes()) {
gs.eventQueue("sc_request.requested_for", current, current.requested_for.getDisplayValue() , previous.requested_for.getDisplayValue());
}

if (current.approval.changes() && current.approval=='approved') {
gs.eventQueue("sc_request.approved", current, current.approval, previous.approval);
}

if (current.escalation.changes() && current.escalation > previous.escalation && previous.escalation != -1) {
gs.eventQueue("sc_request.escalated", current, current.escalation , previous.escalation );
}

if (current.active.changesTo(false)) {
gs.eventQueue("sc_request.inactive", current, current.stage, previous.stage);
gs.workflowFlush(current);
}

Regards,

Roopa

1 ACCEPTED SOLUTION

By the looks of it it should be simple to handle this.

Change this to before BR and remove/comment the current.update() line and this should fix it

 

Please mark my answer correct/helpful if it helped you solve your issue.

-Anurag

-Anurag

View solution in original post

7 REPLIES 7

By the looks of it it should be simple to handle this.

Change this to before BR and remove/comment the current.update() line and this should fix it

 

Please mark my answer correct/helpful if it helped you solve your issue.

-Anurag

-Anurag

Community Alums
Not applicable

Removed only that  current.update()

Its working fine. Didnt change to before , will it be ok

the after BR wont save the value of due daye, change it to before BR, that doesn't need current.upate.

 

Also if this is answered now then please mark my answer correct/helpful and close this thread.

-Anurag