Skip to main content

SF-0091 · Scenario · Medium

Can we use validation rule to make the field mandatory and why we use validation rule for this instead of using page layout or making a field required when creating the field?

✓ Verified by Vikas Singhal · Last reviewed 5/17/2026 · Updated for Spring '26

Yes, you can use a validation rule to make a field effectively mandatory. The trick to this interview question is explaining when each approach is right, because Salesforce gives you three ways to require a value and they’re not interchangeable.

The three places you can make a field required

WhereScopeBypassable?
Field-level required (set on field creation, e.g. Name required)Every save, everywhere — API, UI, all profiles, all record typesNo
Page layout requiredOnly on records edited through that specific page layoutYes — API saves, other layouts, Quick Actions skip it
Validation rule with ISBLANK()Only when your formula says so — can branch on record type, stage, profile, custom permissionYes — by bypass permission you design

Why use a validation rule instead of the other two

The keyword is conditional. Field-level required and page-layout required are unconditional — true everywhere or true on one layout.

A validation rule lets you say things like:

// Require Close_Date when Stage is "Closed Won"
AND(
  ISPICKVAL(StageName, "Closed Won"),
  ISBLANK(CloseDate)
)

// Require Industry only for one record type
AND(
  RecordType.DeveloperName = "Strategic_Account",
  ISBLANK(Industry)
)

// Require Phone only for sales-team profiles
AND(
  $Profile.Name = "Sales",
  ISBLANK(Phone)
)

None of those can be expressed with field-level or page-layout required.

The decision flow

  1. Should this field be required for every save in the org, forever? → Mark the field required at creation.
  2. Should it be required only on this page layout (e.g. the rep-facing form, not the integration)? → Page layout required.
  3. Is the requirement based on the value of another field, the record type, or the user?Validation rule.

A side benefit of validation rules

They produce a custom error message. Field-level required errors are generic (“Field is required”). Validation rules let you say “Please enter a Close Date — Opportunities can’t be won without one” — which is much more actionable for users.

What interviewers want

  • A clean “yes” with AND(ISBLANK(field), ...) shown
  • The explicit comparison to page layout and field-level required
  • The conditional requirement point — that’s the whole reason validation rules exist for this

Verified against: Salesforce Help — Make Fields Required. Last reviewed 2026-05-17 for Spring ‘26 release.