You need to sign in to do that
Don't have an account?
Eric Fischl
Trigger check value of related field to fire
Hi, simple question here that's stumping me: I have a trigger on EmailMessage that I only want to fire if a checkbox on the related Case object = True. Trolling the forums has got me close but I'm still missing something ... any help greatly appreciated! Incomplete code snippet:
trigger EmailMessageCopyToCaseComments on EmailMessage (after insert) { for(email e : [Select Initial_Email_Received__c From Case Where Id = :email.parentID { if(!c.Initial_Email_Received__c = 'TRUE' { EmailMessageCopyToCaseCommentsTrigger.copyEmailMessagesToCaseComments(Trigger.new);} }
In the requirement you have mentioned that you want to fire email if the checkbox is true. But in the IF condition you are using the NOT Equal to operator. Try to replace it like below :-
Kindly mark it as the best answer if it helps,
Regards,
Priya Ranjan
Basically I need to:
1. Determine if the value of a checkbox on CASE is true or false
2. If true, fire the trigger on EmailMessage
I'm getting myself sideways trying to find the proper spot to fetch that CASE value (and sorry, I'm not a developer but filling in for one). Any help greatly appreciated!