Scenario : I have case object. This case object has email related list. Case has contact and contact email address field. From email related list user will send email to contact associated with case. If the email is UNDELIVERED(Bounce back) then I need to send email to account team members associated with account in case.
What I have done so far,
- created one formula field(Mail bounced) to flag if undelivered using EmailBounceReason != null formula in case
- Then created one workflow with criteria as if Mail bounced == true. Added a Email Alert action to send to account team members.
failed reason : formula field is updating after some time so it is not getting the value.
- Added another checkbox field in case. Am trying to update this field when email is undelivered from TRIGGER(after insert of EmailMessages). But I can't able to get the value of the formula field while querying because it is taking some time.
So that formula field is taking some time to update that causes the problem.
What will be the best approach to do this scenario?. Any help is appreciable. Thanks!.