Fatskills
Practice. Master. Repeat.
Study Guide: TECH **Salesforce Administrator: Field Dependencies, Validation Rules, and Formula Fields**
Source: https://www.fatskills.com/salesforce-certification/chapter/tech-salesforce-administrator-field-dependencies-validation-rules-and-formula-fields

TECH **Salesforce Administrator: Field Dependencies, Validation Rules, and Formula Fields**

By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.

⏱️ ~8 min read

Salesforce Administrator: Field Dependencies, Validation Rules, and Formula Fields

A Hyper-Practical, Zero-Fluff Study Guide


1. What This Is & Why It Matters

You’re the Salesforce Admin for a growing SaaS company. Your sales team complains that reps keep entering invalid data—like closing deals with negative amounts or leaving critical fields blank. Meanwhile, your support team wastes hours manually correcting records because picklists don’t update based on other selections. Field Dependencies, Validation Rules, and Formula Fields are your Swiss Army knife for fixing this.


  • Field Dependencies let you control which picklist values appear based on another field’s selection (e.g., only show "Enterprise" pricing tiers if "Customer Type" is "Enterprise").
  • Validation Rules act as gatekeepers, blocking bad data before it enters the system (e.g., "Opportunity Amount cannot be negative").
  • Formula Fields dynamically calculate values without manual input (e.g., "Discounted Price = List Price × (1 - Discount %)"), saving time and reducing errors.

Why this matters in production:
- Data integrity: Bad data = bad reports = bad decisions. Validation Rules prevent garbage in, garbage out.
- User experience: Field Dependencies reduce cognitive load—users only see relevant options.
- Automation: Formula Fields eliminate manual calculations, reducing human error.
- Compliance: Validation Rules enforce business rules (e.g., "All Opportunities over $10K must have a signed contract").

Real-world scenario:
You inherit a Salesforce org where sales reps keep entering Opportunities with: - Negative amounts.
- Missing "Close Date." - "Stage" set to "Closed Won" but "Probability" left at 50%.

Your mission: Lock this down without writing code.


2. Core Concepts & Components


Field Dependencies

  • Definition: A relationship between two picklist fields where the values in the dependent field change based on the selection in the controlling field.
  • Production insight: If you don’t set dependencies, users see all picklist values, leading to confusion and errors (e.g., selecting "Free Trial" for an "Enterprise" customer).
  • Example: Controlling field = "Customer Type" (values: SMB, Enterprise, Government). Dependent field = "Pricing Tier" (values: Basic, Pro, Enterprise, Government Contract).

Validation Rules

  • Definition: Rules that check data against criteria before saving a record. If the rule evaluates to TRUE, the record is blocked, and an error message appears.
  • Production insight: Overuse can frustrate users (e.g., blocking a record for a missing non-critical field). Balance strictness with usability.
  • Syntax: Uses Boolean logic (AND, OR, NOT) and formula functions (e.g., ISPICKVAL(), ISBLANK()).
  • Example: Amount < 0 → Error: "Opportunity Amount cannot be negative."

Formula Fields

  • Definition: Read-only fields that calculate values dynamically using formulas (e.g., Annual_Revenue__c = Monthly_Revenue__c * 12).
  • Types:
  • Text: Returns text (e.g., IF(StageName = "Closed Won", "Won", "Open")).
  • Number: Returns a number (e.g., Amount * Probability).
  • Checkbox: Returns TRUE/FALSE (e.g., ISPICKVAL(StageName, "Closed Won")).
  • Date: Returns a date (e.g., TODAY() + 30).
  • Currency: Returns a currency value (e.g., List_Price__c * (1 - Discount__c)).
  • Production insight: Formula fields do not trigger workflows or processes (unlike regular fields). Use them for calculations, not automation.
  • Performance note: Complex formulas (especially with cross-object references) can slow down reports and page loads.


3. Step-by-Step Hands-On


Prerequisites

  • A Salesforce org (Developer Edition is fine).
  • System Administrator permissions.
  • A custom object (or use Opportunity for practice).


Task 1: Create a Field Dependency

Goal: Make "Pricing Tier" depend on "Customer Type" (e.g., only show "Enterprise" pricing for "Enterprise" customers).


  1. Navigate to SetupObject ManagerOpportunityFields & Relationships.
  2. Create the controlling field (if it doesn’t exist):
  3. Click NewPicklist → Name: Customer_Type__c.
  4. Values: SMB, Enterprise, Government.
  5. Click Save.
  6. Create the dependent field:
  7. Click NewPicklist → Name: Pricing_Tier__c.
  8. Values: Basic, Pro, Enterprise, Government Contract.
  9. Click Save.
  10. Set up the dependency:
  11. Click Field Dependencies (under "Fields & Relationships").
  12. Click New.
  13. Controlling Field: Customer_Type__c.
  14. Dependent Field: Pricing_Tier__c.
  15. Click Continue.
  16. Map the values:
  17. For SMB, check Basic and Pro.
  18. For Enterprise, check Enterprise.
  19. For Government, check Government Contract.
  20. Click Save.
  21. Test it:
  22. Create a new Opportunity.
  23. Set Customer_Type__c to EnterprisePricing_Tier__c should only show Enterprise.

Task 2: Create a Validation Rule

Goal: Block Opportunities with negative amounts or missing Close Dates.


  1. Navigate to SetupObject ManagerOpportunityValidation Rules.
  2. Click New.
  3. Rule Name: Prevent_Negative_Amount_Or_Missing_Close_Date.
  4. Error Condition Formula:
    plaintext
    OR(
    Amount < 0,
    ISBLANK(CloseDate)
    )
  5. Error Message:
    plaintext
    "Opportunity Amount cannot be negative, and Close Date is required."
  6. Error Location: CloseDate (so the error appears next to the field).
  7. Click Save.
  8. Test it:
  9. Try saving an Opportunity with Amount = -100 → Error should appear.
  10. Try saving with CloseDate blank → Error should appear.

Task 3: Create a Formula Field

Goal: Calculate "Weighted Revenue" (Amount × Probability) as a currency field.


  1. Navigate to SetupObject ManagerOpportunityFields & Relationships.
  2. Click NewFormula.
  3. Field Label: Weighted_Revenue__c.
  4. Formula Return Type: Currency.
  5. Formula:
    plaintext
    Amount * (Probability / 100)
  6. Decimal Places: 2.
  7. Click NextNextSave.
  8. Test it:
  9. Create an Opportunity with Amount = 1000 and Probability = 50.
  10. Weighted_Revenue__c should show 500.00.

4. ? Production-Ready Best Practices


Field Dependencies

  • Limit controlling fields to 1: Salesforce only allows one controlling field per dependency.
  • Avoid circular dependencies: If Field A depends on Field B, Field B can’t depend on Field A.
  • Use for picklists only: Dependencies only work with picklist fields.
  • Test in Sandbox first: Changes affect all users—test in a sandbox before deploying to production.

Validation Rules

  • Start with a single rule: Debugging is easier if you add rules one at a time.
  • Use descriptive error messages: Tell users exactly what’s wrong (e.g., "Close Date must be in the future").
  • Avoid over-validation: Don’t block records for minor issues (e.g., missing a non-critical field).
  • Exclude admins (if needed): Use NOT($Profile.Name = "System Administrator") to let admins bypass rules.
  • Log errors: Use a custom object to track validation rule failures for auditing.

Formula Fields

  • Keep it simple: Complex formulas slow down reports and page loads.
  • Avoid cross-object references: Account.Owner.Profile.Name is slow—use a workflow rule or flow instead.
  • Use TEXT() for picklists: TEXT(StageName) is more reliable than ISPICKVAL() in some cases.
  • Test edge cases: What if Probability is blank? Handle it with BLANKVALUE(Probability, 0).
  • Document formulas: Add a description to the field explaining its purpose.


5. ⚠️ Common Mistakes & Traps

Mistake Symptom Fix/Prevention
Validation rule blocks all records Users can’t save any records, even valid ones. Test the rule with FALSE first to ensure it doesn’t block everything.
Formula field returns #Error! Field shows #Error! instead of a value. Check for division by zero (IF(Denominator = 0, 0, Numerator/Denominator)).
Field dependency doesn’t update Dependent field shows all values, not filtered ones. Ensure the controlling field is a picklist (not a checkbox or text field).
Validation rule fires on edit but not create Rule works when editing but not when creating a record. Use ISNEW() to handle create vs. edit scenarios.
Formula field doesn’t update Formula result is stale (e.g., TODAY() doesn’t change). Formula fields recalculate on record load—use a workflow rule or flow for real-time updates.


6. ? Exam/Certification Focus


Typical Question Patterns

  1. "Which tool enforces data quality by blocking invalid entries?"
  2. Validation Rule (blocks saves).
  3. ❌ Workflow Rule (doesn’t block saves).
  4. ❌ Formula Field (read-only).

  5. "How do you make a picklist field show only certain values based on another field?"

  6. Field Dependency.
  7. ❌ Validation Rule (doesn’t filter picklists).
  8. ❌ Formula Field (doesn’t filter picklists).

  9. "Which formula returns the day of the week for a date field?"

  10. CASE(MOD(Date__c - DATE(1900, 1, 7), 7), 0, "Sunday", 1, "Monday", ...).
  11. TEXT(DAY(Date__c)) (returns day of month, not day of week).

  12. "How do you prevent users from entering a negative number in a currency field?"

  13. ✅ Validation Rule: Amount < 0.
  14. ❌ Formula Field (can’t block saves).
  15. ❌ Workflow Rule (can’t block saves).

Key ⚠️ Trap Distinctions

  • Validation Rules vs. Workflow Rules:
  • Validation Rules block saves if the condition is TRUE.
  • Workflow Rules trigger actions (e.g., email alerts) if the condition is TRUE.
  • Formula Fields vs. Roll-Up Summary Fields:
  • Formula Fields calculate values (e.g., Amount × Probability).
  • Roll-Up Summary Fields aggregate child records (e.g., SUM(Opportunities.Amount)).
  • Field Dependencies vs. Record Types:
  • Field Dependencies filter picklist values based on another field.
  • Record Types control page layouts and picklist values based on record type.


7. ? Hands-On Challenge (with Solution)


Challenge

Create a Validation Rule that: 1. Blocks Opportunities where Stage = "Closed Won" but Probability ≠ 100.
2. Shows the error next to the Probability field.

Solution

  1. Validation Rule Formula:
    plaintext
    AND(
    ISPICKVAL(StageName, "Closed Won"),
    Probability <> 100
    )
  2. Error Message:
    plaintext
    "Probability must be 100% for Closed Won Opportunities."
  3. Error Location: Probability.

Why it works:
- ISPICKVAL() checks if StageName is "Closed Won".
- Probability <> 100 ensures Probability is 100.
- AND() combines both conditions.


8. ? Rapid-Reference Crib Sheet


Field Dependencies

  • Controlling Field: Must be a picklist.
  • Dependent Field: Must be a picklist.
  • Max dependencies per org: 10,000.
  • ⚠️ Exam trap: Dependencies do not work with checkboxes or text fields.

Validation Rules

  • Syntax: Boolean formula (returns TRUE to block save).
  • Functions:
  • ISBLANK(field) → Checks if field is empty.
  • ISPICKVAL(field, "value") → Checks picklist value.
  • ISNEW() → Returns TRUE for new records.
  • Error Location: Field where the error should appear.
  • ⚠️ Exam trap: Validation Rules do not run on undelete or restore.

Formula Fields

  • Return Types: Text, Number, Checkbox, Date, Currency.
  • Common Functions:
  • IF(logical_test, value_if_true, value_if_false).
  • TEXT(picklist_field) → Converts picklist to text.
  • TODAY() → Returns current date.
  • BLANKVALUE(field, default) → Handles nulls.
  • ⚠️ Exam trap: Formula fields do not trigger workflows or processes.


9. ? Where to Go Next

  1. Salesforce Trailhead: Validation Rules
  2. Salesforce Help: Formula Fields
  3. Salesforce Help: Field Dependencies
  4. Book: Salesforce Platform App Builder Certification Guide (Chapter 4: Data Modeling).

Final Tip:
Start small. Pick one object (e.g., Opportunity), add one Validation Rule, one Formula Field, and one Field Dependency. Test it, then scale. Done is better than perfect.



ADVERTISEMENT