-
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
How to Choose CRM for Your Organization
Organizations always prefer a single platform that is able to support all the business needs ... Organizations always prefer a single platform that is able…
Salesforce to Salesforce Integration Using REST API
After learning the REST API, it's always good to do some practice to make the concept more clear. In this Blog, we will Integrate Two…
What is the benefit of integrating Marketing Cloud with Whatsapp?
Introduction In today's digitally connected world, effective marketing is all about meeting your audience where they are. WhatsApp, with its over two billion active users,…
Popular Salesforce Videos
What is Salesforce CRM?
What is Salesforce CRM? Join this useful group for Salesforce job & career info and learn all about Salesforce CRM.
App to Track Your Trailblazer Journey | Are you a Trailblazer? | Mini Project | Salesforce Tutorials
In this video I will create an App to track our Trailblazer Journey. You will find out if you are a Trailblazer by watching this…
Salesforce Document Automation
Salesforce recently announced the release of an Intelligent Document Automation tool aimed at allowing healthcare and life sciences companies to digitize document-management processes. The tool,…