You need to sign in to do that
Don't have an account?

Allow disable of "send notification email" when updating lead owner via APEX
Hello,
I have a trigger that is changing the owner (After update, After insert) and each time the owner is change a notification email is sent to the new owner.
It seems it cannot be disable even with the DML option :
Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerAutoResponseEmail = false;
dlo.EmailHeader.triggerOtherEmail = false;
dlo.EmailHeader.triggerUserEmail = false;
dlo.assignmentRuleHeader.useDefaultRule= false;
database.update(LeadstoUpdate,dlo);
Is there another way to disable this email ? I found a lot of post asking that but no real solution.
Thanks for your help
I have a trigger that is changing the owner (After update, After insert) and each time the owner is change a notification email is sent to the new owner.
It seems it cannot be disable even with the DML option :
Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerAutoResponseEmail = false;
dlo.EmailHeader.triggerOtherEmail = false;
dlo.EmailHeader.triggerUserEmail = false;
dlo.assignmentRuleHeader.useDefaultRule= false;
database.update(LeadstoUpdate,dlo);
Is there another way to disable this email ? I found a lot of post asking that but no real solution.
Thanks for your help
Hi ,
To avoid such kind of sitiation we use a boolean variable in an If loop.
If (Booleen = 0 ) {
Process
}
Else
Dont Process
Try if you can implement the same logic in your Code.
Regards,
Ashish
Using apex, this is the only way to enable or disable Send Email Notificaiton
This is how its done
Hope this helps
Regards,
Abhi Tripathi
Salesforce Developer