Follow the steps below to create overlap alerts in Salesforce.
In this article:
Option 1: Create Email Template
Click on the Setup icon in the top right corner:
From the search bar, type Email Templates and select Classic Email Templates:
Next, create a new Email Template. Click on the New Templates button.
Under Choose the type of email template, select Text and click next.
Additional email template options can be viewed here.
In the next screen, fill in: Email Template Name, Subject, and Email Body.
Check the Available For Use checkbox.
To provide a link to the Overlap record:
open an existing Overlap record and replace the Id in the link with
{!xbeamprod__Crossbeam_Overlap__c.Id}
Click Save.
Create Email Alerts
Create two Email Alerts: one for Account Owner and the other for Lead Owner.
In the search bar, type Email Alert and select Email Alerts from the dropdown options
Click New Email Alert to create a new Email Alert.
Name your first Email Alert as New Overlap Notification - Account Owner
Description: New Overlap Notification - Account Owner
Object: Crossbeam Overlap
Email Template: New Overlap Notification
Recipient Type: Account Owner (Move “Account Owner” from Available Recipients to Selected Recipients)
From Email Address: Current User’s email address (Select Org-Wide email address if applicable)
Click Save & New
Name your second Email Alert as New Overlap Notification - Lead Owner
Description: New Overlap Notification - Lead Owner
Object: Crossbeam Overlap
Email Template: New Overlap Notification
Recipient Type: Related Lead or Contact Owner (Move “Lead or Contact Owner” from Available Recipients to Selected Recipients)
From Email Address: Current User’s email address (Select Org-Wide email address if applicable)
Click Save.
Create a Flow
In the search box, type in Flow and select Flows from the dropdown options.
Click New Flow on the top right to create a new Flow.
Select Record-Triggered Flow and click Next. Select Auto-Layout and click Next.
In Configure Start:
Object: Crossbeam Overlap
Configure Trigger: A record is created
Optimize the Flow for: Actions and Related Records
Click the “+” to add a “Decision” element
Label: Account or Lead
There should be 3 Outcomes
Account
Label = Account
Condition Requirements to Execute Outcome = All Conditions Are Met (AND)
{!$Record.xbeamprod__Account__c} Is Null = {!$GlobalConstant.False}
Lead
Label = Lead
Condition Requirements to Execute Outcome = All Conditions Are Met (AND)
{!$Record.xbeamprod__Account__c} Is Null = {!$GlobalConstant.True}
{!$Record.xbeamprod__Lead__c} Is Null = {!$GlobalConstant.False}
Default Outcome
Click the “+” under the Account Path and select Action
Search for New Overlap Notification - Account Owner and select New Overlap Notification - Account Owner
Label = New Overlap Notification - Account Owner
Record Id = {!$Record.Id}
Click the “+” under the Lead Path and select “Action”
Search for “New Overlap Notification - Lead Owner” and select “New Overlap Notification - Lead Owner”
Label = New Overlap Notification - Lead Owner
Record Id = {!$Record.Id}
Save and activate the Flow. Your Flow should look something like this.
Option 2: Create a Flow
In the search bar, type in Flow and select Flows.
Click New Flow on the top right to create a new Flow.
Select Record-Triggered Flow and click Next. Select Auto-Layout and click Next.
In Configure Start:
Object: Crossbeam Overlap
Configure Trigger: A record is created
Optimize the Flow for: Actions and Related Records
Click “New Resource” under the “Toolbox” and select “Text Template”
API Name = NewOverlapNotificationTemplate
Body = The email body.
Example:
Hello, A new Overlap record was created. Link to record: https://candyboxcrm--crossbeam.lightning.force.com/lightning/r/xbeamprod__Crossbeam_Overlap__c/{!record.Id}/view
Click New Resource under the Toolbox and select Formula
API Name = EmailAddressFormula
Data Type = Text
Formula = IF( {!$Record.xbeamprod__Account__c} != '', {!$Record.xbeamprod__Account__r.Owner.Email}, {!$Record.xbeamprod__Lead__r.Owner:User.Email} )
Click the “+” and select Action. Select Send Email.
Set the variable values like below:
Click the Done button.
Your flow should look like this: