+ Start a Discussion
TrimbleAgTrimbleAg 

Case Reopened Count?

Hello All!

 

Trying to figure out how to make a formula so that everytime a case changes from closed, to another status, that it adds 1 to the count? I cant figure this out any suggestions would be great!

Best Answer chosen by Admin (Salesforce Developers) 
BA_AdminBA_Admin

Ok follow these steps.

 

1) Create a number field Ex Status Count  and default this to 0

2) Create WFR with criteria Record is created or updated, use this formula

 

AND(ISCHANGED(Status),
ISPICKVAL( PRIORVALUE(Status),"Closed"),
 (OR(ISPICKVAL(Status,"New"),ISPICKVAL(Status,"Assigned"),ISPICKVAL(Status,"Under Review")))))

 

3) Use the action field update select the field Status count and select use formula

 

Status_Count__c + 1

 

Here the field gets updated if the status is changed from closed to New or Assigned or Under Review

 

 

 

All Answers

Steve MolisSteve Molis

Which edition of SFDC are you using?  If you're on EE or UE you migght be able to do this with a Wokflow Rule and a Field Update.

TrimbleAgTrimbleAg

I'm on EE, I tried this, but cant figure out how to only fire this so that when a case status changes from closed.

 

I can count the number of time it has closed and have that setup, but it would be better if I can count only the amount of times it has been re-opened.

 

PB

Steve MolisSteve Molis

can you post your WFR Code?

TrimbleAgTrimbleAg

I'm just using a simple statment:

 

If  -Case Status- Equals -Closed-  

 

It evalutes to true, then the field update ands a count.

 

PB

BA_AdminBA_Admin

Ok follow these steps.

 

1) Create a number field Ex Status Count  and default this to 0

2) Create WFR with criteria Record is created or updated, use this formula

 

AND(ISCHANGED(Status),
ISPICKVAL( PRIORVALUE(Status),"Closed"),
 (OR(ISPICKVAL(Status,"New"),ISPICKVAL(Status,"Assigned"),ISPICKVAL(Status,"Under Review")))))

 

3) Use the action field update select the field Status count and select use formula

 

Status_Count__c + 1

 

Here the field gets updated if the status is changed from closed to New or Assigned or Under Review

 

 

 

This was selected as the best answer
Steve MolisSteve Molis

Well check you out @Venu4790!  You've learned well Grasshopper! ;-p  

BA_AdminBA_Admin

@Steve! ..It's all You :)

TrimbleAgTrimbleAg

Thank you both for the help!!

 

PB

TrimbleAgTrimbleAg

Hmmm, I keep getting an error that the ISCHANGE may not be used in this type of formula?

 

PB

Steve MolisSteve Molis

When is your WFR set to trigger?  You can only use ISCHANGED everytime the Record is Edited.  

 



ISCHANGED

Description:Compares the value of a field to the previous value and returns TRUE if the values are different. If the values are the same, this function returns FALSE.
Use:ISCHANGED(field)and replace field with the name of the field you want to compare.
Validation Rule Example:The following validation rule prevents users from changing an opportunity name after it has been created:NOT(ISCHANGED(Name)).

NOT(AND(ISCHANGED(Priority), ISPICKVAL(Priority, “Low”)))is a validation rule that ensures if a user changes the Priority of a case, the new priority cannot be “Low.”

NOT(AND(ISCHANGED(CloseDate), ​OR(MONTH(CloseDate) <> MONTH(TODAY()), ​YEAR(CloseDate) <> YEAR(TODAY())),$Profile.Name <> "Sales Manager"))is a validation rule that prevents a user from changing the Close Dateof an opportunity to a date outside of the current month and year unless that user has the “Sales Manager” profile.Note
$Profile merge fields are only available in Enterprise, Unlimited, and Developer Editions.
Tips:
  • This function is available only in:
    • Assignment rules
    • Validation rules
    • Field updates
    • Workflow rules if the trigger type is set to Every time a record is created or edited.
  • Use the NOT function to reverse the return values of TRUE and FALSE.
  • This function returns FALSE when evaluating any field on a newly created record.
  • If a text field was previously blank, this function returns TRUE when it contains any value.
  • For number, percent, or currency fields, this function returns TRUE when:
    • The field was blank and now contains any value
    • The field was zero and now is blank
    • The field was zero and now contains any other value
BA_AdminBA_Admin

Did you read my second line, probably you might be using the 1st criteria use the criteria where only record is created or edited

TrimbleAgTrimbleAg

thank you again!

 

Sorry, been a long day, I need to read more!

 

PB

Maria HuemmerMaria Huemmer
You can also use PRIORVALUE(IsClosed) == True if you don't want to list out all the statuses or there's a chance new closed statuses will be added in the future.