-
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
Top 6 Qualities of Salesforce Consulting Partners to Look Out For in 2024
When it comes to CRM, anywhere we go in India or across the globe, everywhere we see Salesforce and Salesforce consulting partners We all know what Salesforce…
Improve Patient Experience with Salesforce Health Cloud
Patients are conserved and sensitive towards what kind of healthcare services they experience. When the systems of healthcare face issues like documentation, customized health plans,…
How To Leverage The Power of Salesforce For Manufacturing?
Manufacturing industries are facing immense pressure to modernize operations and reinvent themselves. Gaining visibility into key customer metrics, a streamlined collaboration between disparate departments, and…
Popular Salesforce Videos
Salesforce Guide to Sharing Architecture
The Salesforce sharing model is an essential element in your organization's ability to provide secure application data access. Therefore, it's crucial to architect your sharing…
Salesforce Workflow vs Process Builder | Salesforce Tutorial
This "Salesforce Workflow vs Process Builder" video by Edureka will firstly help you understand what exactly is Salesforce workflow and what is Salesforce process builder.…
Algoworks Becomes SFDO Partner | Salesforce Partner
The Salesforce Partner Program gives the opportunity to its partners to build and grow successful businesses while delivering customer success. With this program, Independent Software…