Salesforce: Common Validation Rules

Validation rules are a staple in every Salesforce admin’s toolkit—but they’re no longer your only option. With enhancements to Salesforce Flow, including Custom Errors, we now have more flexibility in how we enforce data quality and user guidance. This post explores the most common validation rules used across Salesforce orgs—and how Flow Custom Errors can be a more dynamic alternative in many scenarios.

REVENOVASALESFORCE ADMINISTRATION

5/5/20251 min read

Missing Appointment Time

Object

Stop

Error Condition

AND( rtms__Appointment_Required__c = TRUE, OR( ISBLANK( rtms__Appointment_Time__c )))

Error Message

Please enter the appointment time. If no appointment time is available, enter 00:00.

Error Location

Appointment Required

Customer Account Creation Restricted to Only System Admin & Accounting (Specific profiles)

Suppose the Customer is included in the TMS Type. In that case, users cannot create (save) or change the Account record unless they are assigned to the Profile of a System Administrator, System Admin, or Accounting user.

Object

Account

Error Condition

AND (

INCLUDES(rtms__TMS_Type__c, "Customer"),

OR (

ISNEW(),

ISCHANGED ( rtms__TMS_Type__c )

),

AND (

$Profile.Name <> "System Administrator"),

($Profile.Name <> "Accounting"),

($Profile.Name <> "System Admin")

)

Error Message

You do not have permission to create or change a Customer Account. Please get in touch with your System Admin or Accounting team for assistance.

Error Location

Appointment Name

Creating a Validation Rule

1. Navigate to Object Manager

  • Go to Setup (click the gear icon in the upper-right corner).

  • Select Object Manager.

  • Search for and select the object for which you want the validation rule (e.g., Stop).

2. Open Validation Rules

  • In the left sidebar of the object, click Validation Rules.

  • Click New.

3. Enter Rule Details

  • Rule Name: Enter a name (e.g., ApptRequired)

  • Description: Describe what this rule does (e.g., "Prevents users from saving a stop without the Appointment Time entered when an Appt is required").

4. Enter the Error Condition Formula

  • Example: AND( rtms__Appointment_Required__c = TRUE, OR( ISBLANK( rtms__Appointment_Time__c )))

5. Enter the Error Message

  • Example: "Please enter the appointment time. If no appointment time is available, enter 00:00."

  • This is what the user will see when the rule is triggered.

6. Choose Where to Display the Error

  • You can display the message:

    • At the top of the page (general error), or

    • Under a specific field (e.g., under the Appt Required field)

7. Click Save

  • Your validation rule is now active! Test it by trying to create or edit a record that violates the rule.

Here is a list of validation rules I've configured.
I'll continue to add to this list as time allows.