You need to sign in to do that
Don't have an account?
deplai
trigger to send email to contact when task is marked public
I would like to write a trigger to send an email to the related contact of a task whenever the task is marked public. Could someone give some direction on how to achieve this? I'm fairly new to writing code. Thanks.
Hi,
You have to simply make the condition inside the trigger which will check for that public check box. Your trigger should be like this:
Trigger onPublicTash on task(after insert,after update)
{
If(publicCheckbox__c == true)//Custom Checkbox field on Activity
{
If(trigger.isinsert)
{
// Write the code for sending an emil to the associated contact.
}
If(trigger.isupdate)
{
// Write the code for sending an emil to the associated contact.
}
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.