Table of Contents
Introduction to Apex Scenario
Develop an Apex Trigger to send the email to the Account owner when the Account is Created within Salesforce and Account does not have the phone and industry field populated.
Also, create a task under the account with the following information
- Subject – The phone and Industry of the Account are Blank
- Description – The phone and Industry of the Account are Blank
- Priority – High
- Status – Not Started
- What Id – Related Account Id
- OwnerId – Related Account Owner
Email Template
Dear <Account Owner>
A new account <account name> has been created in Salesforce. The account is missing some important information Phone & Industry.
Please try to collect this information and update the account ASAP.
Thanks & Regards,
<Company Name>
Questions to be asked
- Which Object?
- Account
- Event?
- after insert
- Requirement?
- Send an Email & Create a Task
Hands-On
Email Utility Class
Handler Class
Watch Complete Video
Resources
- https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_single.htm#apex_classes_outbound_single
- https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_messaging.htm#apex_System_Messaging_sendEmail
- https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_sendemailresult.htm
- https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_attachment.htm
- https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_sendemailerror.htm
- https://www.pantherschools.com/category/developer/
