Incrementing a Call Count

Cupcake
Mega Guru

I have created a variable "Call counter" and another variable "Increment call" (which is a checbox), Here is my sceanrio:

1) Customer calls SD to have a ticket opened for an issue,

2) An hour later the customer calls back for a status, at this time the analysts checks the "increment call" button, the call counter starts at "0" and is suppose to increase each time the customer calls back.

3) So I need the call count value to be saved, I need the increment call option to be unchecked after the incident is updated, and I need the call counter value to increase by 1 the next time someone goes into that incident and clicks that increment call checkbox again.

Hope that makes sense.

Karen

1 ACCEPTED SOLUTION

ahaz86
Mega Guru

a before business rule would work for this i believe.



if(current.u_increment_call == true){


        var count = current.u_call_counter;


        current.u_call_counter = count + 1; // add one to the count


        current.u_increment_call = 'false'; // reset the count increment flag


}


View solution in original post

13 REPLIES 13

You have to go to here first to login


Hi Alex,


        Thanks, No worries. After I emailed you back, I looked a second time and I saw the one small minor mishap in the business rule. I corrected it, tested and it is working as intended. Your assistance has been greatly appreciated. You have a good rest of your week.


ok awesome, what did you find wrong with the business rule (so i can correct it on here in case anyone else stumbles across this thread)



Also, if i answered your question please mark the response as the correct answer.



Thanks,


Alex


I did. Thanks again for your help.