function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nancy Rodriguez 4Nancy Rodriguez 4 

Email Message Validation in Lead Object

Hi,

My organization have an issue with manual's emails been sent with the incorrect "From Address" and we need to have a validation rule to prevent this human error from keep happening. I looked at the Email Message Validation Rules but it cannot be done because it doesn't have the "RelatedTo" lookup field. I used the ParentId field but it seems that this is only getting populated with the "Case" object.  Below the validation I tried to do, and I need to find a workaround.

&&
or( 
and(ISPICKVAL(Parent.Lead__r.field,'one'),FromAddress != 'one@test.com'), 
and(ISPICKVAL(Parent.Lead__r.field,'two'),FromAddress != 'two@test.com')
)

Looking around traiblazer communities suggested a trigger, but  I don't see the Lead object listed as a related object in the "RelatedTo" field.

I need to validate the "From Address" for the email to be sent to a Lead based on a specific picklist value of the record, any sugestion how to acomplish this?

Thanks,
 
Raj VakatiRaj Vakati
What can't you write a trigger ?? i think trigger will work .. 

 
Nancy Rodriguez 4Nancy Rodriguez 4
Hi Rajamohan, When I was looking at the Email Message object the “Related To “ didn’t include the lead object. [image: https://raw.githubusercontent.com/HigherEducation/email-signature/master/logo-highereducation_21x.png] *Nancy Rodriguez* | Senior Salesforce Administrator (954)-395-2644 *nrodriguez@highereducation.com *
Nancy Rodriguez 4Nancy Rodriguez 4
Hi,
I haven't been able to connect the Lead object to the Email Message object, I'm in need of a solution here.

Thanks!