Thursday, September 8, 2011

Escalation Queues and workflows.

I recently had a need to escalate a case which has status value new and in a queue for 2 hours, So that if nobody picks up the case it would be escalated to manager.

It took me about a day to figure out how to write the entry criteria to check whether the case is in a queue or assigned to a owner. salesforce Ids has a certain pattern across all org for certain objects. so by that i figured out that users always started with 005 and group and queue always started with 00G.

Also i had to use 'Formula evaluates to true'  instead of easy 'Criterias are met' as owner ids are not available in this. Here is the formula i used.

AND(  ISPICKVAL( Status ,"New") , BEGINS(OwnerId, "00G") ,not( IsClosed ) )  

 Now coming to other stuffs
  
Realized that Case Escalation cannot trigger a workflow. Case escalation would cause an 'isEscalated' flag to be checked. I assumed that it can be used to trigger a workflow. i used the same entry criteria in workflow as in the escalation rule and used time dependent action instead. Thankfully my use case needed field updates only for the first time the case is escalated.


Couple of more things changes to formulae field would not trigger the workflow and so also field update from a workflow. This link might be useful Workflow considerations

If you could find if salesforce has documented somewhere which all will trigger a workflow, Let me know