-
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[] {'abc@gmail.com'}; mail.setToAddresses(toAddresses); mail.setReplyTo('abc@gmail.com'); 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
5 Key Benefits of Salesforce CPQ to Your Sales Team
Salesforce CPQ increases the efficiency of the sales team by creating quotes that are curated with the diverse knowledge all brought to one place which…
Salesforce with Jira - A No Code Integration Guide
To begin, Exalate must be installed on both Jira and Salesforce. After that, you proceed to establish a link between them. After that, you can…
Calling from Salesforce: Use RingCentral
Hello Everyone, Salesforce is nowadays a huge platform for all the developers, administrators, and users as well. So in this tech world, everyone needs a…
Popular Salesforce Videos
SelectList, select Option & Action Function in Salesforce Apex Language
If you work upon salesforce and VF Pages, you have seen these words one is rendered, reRender, ActionFunction, param, onclick, onchange, In this video, you…
How to Use Salesforce Process Builder 2017
Salesforce process builder is a powerful tool you can use to automate business processes. It has a simple interface that allows you to point and…
Salesforce Service Cloud: Upload Files During a Live Chat
Chatbots are incredible automation tools that can streamline a variety of business processes. Still, regardless of how much they can accomplish, there are situations where…