Before You Begin:
1. If you haven't already, deploy the pre-requisite Flows: Flow-Into-Apex Package
2. Click on "Run Tests Only" before making any changes. This ensures the Flow works as is without updating the challenge progress.
3. Deactivate the Flow & rebuild as Apex
4. Hit the "Submit" button when you're ready to have your final solution evaluated and challenge progress updated
1. If you haven't already, deploy the pre-requisite Flows: Flow-Into-Apex Package
2. Click on "Run Tests Only" before making any changes. This ensures the Flow works as is without updating the challenge progress.
3. Deactivate the Flow & rebuild as Apex
4. Hit the "Submit" button when you're ready to have your final solution evaluated and challenge progress updated
Flow To Convert:
Lead - Create Task to Schedule Demo
Description:
When a Lead record is created, automatically create a related Task record for the Lead owner with the following information:
- WhoId: Lead ID
- Subject: Schedule Demo Call
- Owner: Lead Owner
- Due Date: 2 weeks in the future
Object & Trigger Event:
Lead, on After Insert
Concepts to learn:
- Creating related records
- Setting due date in the future
- Catching DML Exceptions
Resources
YouTube Videos
- Flow into Apex: TRIGGER your Coding Powers in Salesforce
- Flow into Apex: Transform Your Salesforce Skills
Salesforce Documentation
- Triggers Overview
- Trigger Syntax
- Trigger Context Variables
- Bulk Apex
- For loops (needed for bulk apex)
- addDays Date Method
- DML Exception Handling
- Inserting and Updating Related Records
Challenge Cheat Codes
- Place your insert logic inside a try-catch block. If a DML Exception occurs, you can simply log it using System.debug() to help with troubleshooting.
- Pro Tip: While debug logs work for this challenge, in real applications, you'll need a better way to capture and address errors, such as custom logging, email alerts, or tracking with Salesforce tools.