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
sfdc dev 2264sfdc dev 2264 

Validation rule on email object help needed

Hi ,

I have the below requirement for which i need help

on the case object i have the related list where i have email object

my requirement is in the "To Address" column i should be able to send a email only from a list of 20 email addresses that i have mentioned.

second condition is if the "To address" email matches with the case email then email should be sent.

if either of the above 2 conditions are satisfied ishould be able to send a email on a email object from a case.

Let me know if it can be acheived using a validation rule if so how it can be achieved.

Thanks in advance
Avishek Nanda 14Avishek Nanda 14
Hi,

When you say Validation , do you mean Standard Validation? If yes you wouldn't be able to do it using standard validation. 

You need to extend the logic using a Class which can be invoked using a button on the Case object. 

You can impliment MassEmailMessage Class  and have your logic validate the Email to which you are sending and the Case email. 

Please Find the link : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_mass.htm

Let me know if this helps. 

Regards,
Avishek Nanda