-
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
Outcome Management in Salesforce Nonprofit Cloud
Salesforce’s Nonprofit Cloud (NPC) is full of many wonderful tools to help nonprofit organizations with funding, delivering, and measuring the impact of services. A nonprofit’s…
Top Sales Challenges in 2023 Which Salesforce Sales Cloud Can Solve
There’s no denying the fact that a sales job is full of challenges. Sales managers are constantly on the lookout for ways to optimize their…
Implementation of Outlook Integration | Salesforce Step-by-Step Guide
In Salesforce, If you want to set up the outlook Integration. First, you have to know about what is the use of Salesforce integration with…
Popular Salesforce Videos
Salesforce Account-Based Marketing Demo
Salesforce Account-Based Marketing is a partnership aligning Marketing, Sales, and Service around a single view of your top accounts. A partnership which reesults in long…
Access Salesforce Maps Schedule and Manage Saved Events
Watch this video to learn how to Access Salesforce Maps Schedule and Review and Manage Saved Events. Do let us know in the comment section…
Salesforce Apex Tutorial for beginners | Apex Salesforce Tutorial
Apex is a proprietary language developed by Salesforce.com. It is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the…