Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I would like to fire a workflow whenever a case comment is created that emails both the case owner and a custom lookup field on the Case Object. I've created one for new Cases fine but when I fire on Case Comments I'm unable to access fields on the Case object as email recipients.

Is there any way to do this with workflows or should I resort to using a trigger on CaseComment?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You are right, you cannot directly do this via workflow.

Rather than resort to a trigger though, can I suggest the following approach.

Use a Workflow rule on Case Comment to enact a field update on the parent Case, which (ensuring you re-evaluate workflow afterwards) can then fire a Workflow rule on the Case (due to the update) that sends an e-mail out to the Case Owner and your custom field?!

diagram

Sounds complicated, but it's not, I promise.

If that "solution" is enough for you to follow through, then perfect, if not you can read/follow this blog post which I wrote to set a custom template, which uses this exact Workflow pair to send the Case owner an e-mail on Case Comment creation - just ignore the custom template bit and follow the additional field work and workflows to trigger the e-mail.

You need the new field and updates etc. on the Case so you only fire the "updated" workflow when it is a new Case Comment causing the update, and not just a user editing a case.

share|improve this answer
    
Thank you, this worked perfectly :) –  Venko May 9 at 10:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.