-
In below code snippet in Salesforce, what is going wrong?
In below code snippet,
trigger TestBeforeDelete on Lead (before Delete) { for(Lead l : Trigger.Old) { l.addError('error'); } String msgBody = 'Test Email'; String Subject = 'Test from Cogni Force on Lead'; Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); String[] toAddresses = new String[] {'[email protected]'}; mail.setToAddresses(toAddresses); mail.setReplyTo('[email protected]'); mail.setSenderDisplayName('Cogniforce Test Simulator'); mail.setSubject(Subject); mail.setPlainTextBody(msgBody); mail.setHTMLBody(msgBody); Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); }
What is your observation and what is going wrong?
Log In to reply.
Popular Salesforce Blogs
Mortgage Innovation for Salesforce Financial Services Cloud
Salesforce recently announced a new feature Called Mortgage Innovation for Financial Services Cloud that is designed to streamline the mortgage application process. This new tool includes a guide…
All You Need to Know about Batch Apex in Salesforce
Contents: What is Batch Apex? Batch Apex is a very powerful asynchronous process introduced by Salesforce. Which is used to process a large number of…
Top Things You Need to Know About Salesforce Communities
Salesforce Communities is a phase that allows our customers to interface with people outside their affiliation using data, participation, and substance. While most Salesforce customers…
Popular Salesforce Videos
Update Record Using Salesforce Flow | Flow Builder Series Salesforce
In this video, we will learn how to use Update Records in Salesforce Flow. Here is the timestamp for your help. ----------------- Update Records in…
Salesforce Tutorial | Data Extensions in Marketing Cloud
In this video, we are going to show you something so simple, yet so powerful, you may not even know it existed. For more Salesforce…
Salesforce Financial Services Cloud Spring '23 Highlights
Shake off those winter blues with the new features coming in Salesforce's Spring '23 Release for Financial Services Cloud. Whether it's ARC enhancements, interaction summary…