Steps to Create a Validation Rule:

TG Database is a platform for organized data management.
Post Reply
nusratjahan
Posts: 51
Joined: Thu May 22, 2025 6:31 am

Steps to Create a Validation Rule:

Post by nusratjahan »

Hard Blocking Lead Creation with Validation Rules (Recommended)
This is the most direct way to prevent "phone number only" leads from being created in the first place, ensuring data quality from the point of entry.

Use Case: When a user (or an integration like Data Loader) tries to create or update a Lead record where an email address is missing, but a phone number is present, the save action will be prevented.


Go to Setup (the gear icon in the top right) > Object Manager.
In the Quick Find box, type Lead and click on the Lead object.
In the left sidebar, click on Validation Rules.
Click the New button.
Rule Name: Prevent_Phone_Only_Leads (or a descriptive name like Require_Email_With_Phone)
Description: Prevents the creation or update of a Lead record if a phone number is present but the email address is blank.
Error Condition Formula:
AND(
ISBLANK(Email),
OR(
NOT(ISBLANK(Phone)),
NOT(ISBLANK(MobilePhone))
)
)
Explanation:
ISBLANK(Email): Checks if the standard Email field on the Lead record is empty.
NOT(ISBLANK(Phone)): Checks if the standard Phone field is NOT empty.
NOT(ISBLANK(MobilePhone)): Checks if the standard MobilePhone field is NOT empty.
OR(...): Checks if either the Phone OR the MobilePhone field has a value.
AND(...): The entire rule triggers if the Email is blank AND at least one phone field (Phone or MobilePhone) has a value.
Error Message: "Leads must include an email address if a phone number is provided. Please enter an email or remove the phone number before saving."
Error Location: Choose Top of Page for a general error, or select a specific field like Email to highlight where the problem is.
Ensure the Active checkbox is checked.
Click Save.
Impact of this Validation Rule:

Manual Lead Creation: Users attempting to save a new Lead albania whatsapp database without an email but with a phone number will see the error and be unable to save.
Data Imports (e.g., Data Loader): Records in import files that violate this rule will fail to import, providing immediate feedback on data quality issues.
Web-to-Lead: If your Web-to-Lead form doesn't require an email, submissions that only contain a phone number will fail to create a Lead in Salesforce. You would need to ensure your web form also enforces email input or handles the error gracefully.
API Integrations: API calls attempting to create such leads will fail, returning an error.
II. Identifying and Managing Existing "Phone Number Only" Leads
For leads already in your system that fit this criteria, you can use:

Reports:

Purpose: To generate a list of all existing Leads (or Contacts, if you want to extend this) that have a phone number but no email.
Steps:
Go to Reports > New Report.
Select the Leads report type.
Go to the Filters tab.
Add a filter: Email field equals (blank).
Add another filter group (using the dropdown arrow next to "Add Filter"):
Phone field not equal to (blank) OR
Mobile Phone field not equal to (blank)
Adjust other filters (e.g., Lead Status) as needed to focus on active leads.
Run and save the report.
Use Cases: This report can be used by a data quality team to research and add missing email addresses, or by sales managers to assign these leads for specific non-email-based outreach (e.g., direct mail campaigns if you have physical addresses).
List Views:

Purpose: To create a quick, accessible list on the Leads tab that displays these "phone number only" leads for easy monitoring and action.
Steps:
Go to the Leads tab.
Click the gear icon (List View Controls) > New.
Give it a name (e.g., "Leads Needing Email").
Apply the same filter logic as described for the report.
Select fields to display (e.g., Lead Name, Phone, Mobile Phone, Lead Source, Lead Status).
Save the list view.
III. Flows for More Flexible "Blocking" or Flagging (Alternative/Complementary)
If you don't want a hard block but rather want to automatically flag, route, or assign tasks for "phone number only" leads, a Record-Triggered Flow is ideal.

Use Case: Allow the creation of phone-only leads, but immediately mark them for data enrichment or special follow-up.

Steps to Create a Record-Triggered Flow:

Go to Setup > Flows.
Click New Flow.
Select Record-Triggered Flow > Create.
Object: Select Lead.
Trigger the Flow When: "A record is created or updated."
Condition Requirements: AND( ISBLANK({!$Record.Email}), OR( NOT(ISBLANK({!$Record.Phone})), NOT(ISBLANK({!$Record.MobilePhone}) ) ) ) (Same formula as the validation rule).
Optimize the Flow for: "Actions and Related Records."
Add Actions (e.g.):
Update Records: Update the current Lead. You could set a custom checkbox field (e.g., Needs_Email_Enrichment__c - you'd create this custom field first) to True. You might also change its Lead Status to "Needs Data Enrichment."
Assign Lead: Reassign the lead to a specific "Data Quality Queue" or a user responsible for enrichment.
Create Task: Create a task for the assigned user to "Find Email Address for Lead: {!$Record.Name}."
Send Email Alert: Notify a data quality manager about the new phone-only lead.
Save and Activate the Flow.
Impact of this Flow: Leads are created, but they are immediately processed, flagged, and potentially assigned to a specific team or person for email enrichment.

Choosing the Best Method:
For a strict "no phone-only leads allowed" policy: Use the Validation Rule. It's simple, effective, and prevents bad data from entering.
For allowing phone-only leads but requiring immediate action/flagging: Use a Record-Triggered Flow.
For identifying existing bad data: Use Reports and List Views.
In most cases, the Validation Rule is the most direct and effective method to "block" the creation of phone-only leads at the point of entry in Salesforce. Remember to clearly communicate this policy and the rationale behind it to your sales and data entry teams.
Post Reply