-
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
G-Connector for Salesforce - Part 1
G-Connector for Salesforce It's a great tool or you can say an add-on that can help you to save your Salesforce Licenses. G-Connector is a…
Things to Consider When Selecting Salesforce Partner in CPQ Consulting
Salesforce CRM has become a revelation in terms of increasing company efficiency. Salesforce has streamlined a variety of processes along the way, from balancing the…
Power of Asynchronous Apex: Benefits and Insights
Introduction Salesforce is renowned for its ability to provide businesses with comprehensive customer relationship management (CRM) solutions. To supercharge its functionality, Salesforce introduced Asynchronous Apex,…
Popular Salesforce Videos
Salesforce Connections 2018 Keynote - Ch. 2: Ticketmaster Is A Trailblazer
Salesforce Connections 2018 Keynote – Ch. 1: Corporate Positioning Salesforce Connections 2018 Keynote – Ch. 2: Ticketmaster Is A Trailblazer Salesforce Connections 2018 Keynote –…
Introduction To Salesforce Integration
This video is about a basic intro to Salesforce Integration What is integration? Types Of integration Benefits of Salesforce integration Best Practices for successful integration…
Create Surveys in Salesforce | Salesforce Tutorial
Learn how to create surveys in Salesforce. In this video, the following points will be covered - 1. Build A Survey Learn how to build…