Reassignment counter

sid23
Mega Contributor

Hello,

Right now we have an OOB business rule called "Reassignment counter". Basically it changes the number in the reassignment count when the assignment group is changed. Below is the script and condition associated to it.

Script - current.reassignment_count += 1;
 
The above is acting on task table.
I want it to work as it is but, when an end user enters the details on the case form, and for an example test scenario i enter incorrect fields and try to save the case but it gives me an error saying invalid entry. So the reassignment count should remain same but its not happening. Even though the case isn't saved the reassignment count is increasing. Is there any way i can write a script saying it should only count or increase the number when the assignment group is changed and also when the case is saved?
 
 
1 ACCEPTED SOLUTION

Can you provide me a screenshot of what you have done?

 

From what I understood, you want to increase the could only when the assignment changes and record is saved successfully.

 

Now you have two fields. reassignment_count and case_reassignment_count.

You only want it to happen for case_reassignment_count.

 

So you modified the BR to be onAfter and added script

 

current.case_reassignment_count += 1;

current.update();

 

From the condition in the script, it seems that case_reassignment_count is incremented when assigned to changes.

If you want it to update for assignment group changes, you should rollback the changes you have done for case_reassignment_count and work on assignment_count


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

9 REPLIES 9

SanjivMeher
Kilo Patron
Kilo Patron

You can change the BR to Async or onAfter and it should work fine.You will just have to add a current.update();


Please mark this response as correct or helpful if it assisted you with your question.

I tried it for Async and onAfter but it didn't work. There is another business rule called "reassignment counter for case" and below is the script - 

Condition - current.assigned_to.changes() && current.assigned_to != '' && previous.assigned_to != current.assigned_to && !(current.case_reassignment_count == 0 && previous.assigned_to == '')

 

Script - 

onBefore(current, previous);
function onBefore(current, previous) {
current.case_reassignment_count += 1;
}

 

This is acting on the case. Any suggestions how i can achieve the functionality?

Ok. Change the BR to onAfter and use below script

 

onAfter(current, previous);


function onAfter(current, previous) {
current.case_reassignment_count += 1;

current.update();
}


Please mark this response as correct or helpful if it assisted you with your question.

Tried doing as you've suggested but still increased.