Question

Difficulty: MediumValidation Rules and Data Quality Enforcement

A Operations Manager at a solar installation enterprise requires that whenever a custom object record named Work_Order__c has its Status__c picklist field set to "Closed", both the Completion_Date__c date field and the Resolution_Summary__c text field must contain data. If either field is missing a value when the status is Closed, the record must fail validation and present an error message to the user. Which formula should be configured in the validation rule to enforce this data quality standard?

  1. AND(ISPICKVAL(Status__c, "Closed"), OR(ISBLANK(Completion_Date__c), ISBLANK(Resolution_Summary__c)))Answer
  2. B
    ISPICKVAL(Status__c, "Closed") && (Completion_Date__c == NULL || Resolution_Summary__c == NULL)
  3. C
    Map the Status__c, Completion_Date__c, and Resolution_Summary__c custom fields on the Lead Conversion Field Mapping setup page to require completion prior to saving.
  4. D
    Remove the "Closed" picklist value from the Work Order Record Type picklist assignment settings until both fields are populated by the user.

Answer

The validation rule formula using AND(ISPICKVAL(Status__c, "Closed"), OR(ISBLANK(Completion_Date__c), ISBLANK(Resolution_Summary__c))) correctly enforces the requirement.
The correct formula uses ISPICKVAL to evaluate the picklist field Status__c and checks if either Completion_Date__c or Resolution_Summary__c is blank using OR(ISBLANK(...), ISBLANK(...)). Combining these within an AND statement ensures the validation rule evaluates to true—and blocks record saving—only when the status is Closed and one or both mandatory fields lack values.

Step-by-Step Solution

1
Identify the condition when the validation error should trigger.
The rule must trigger when Status__c is set to "Closed". In Salesforce formula syntax, picklist values are checked using ISPICKVAL(Status__c, "Closed").
Direct text comparison on picklist fields in validation formulas requires the ISPICKVAL function.
2
Identify the condition for missing mandatory fields.
Either Completion_Date__c is blank OR Resolution_Summary__c is blank, represented by OR(ISBLANK(Completion_Date__c), ISBLANK(Resolution_Summary__c)).
ISBLANK is the standard and recommended function for checking blank/null values across text and date fields.
3
Combine the conditions into a complete validation logic statement.
AND(ISPICKVAL(Status__c, "Closed"), OR(ISBLANK(Completion_Date__c), ISBLANK(Resolution_Summary__c))).
Validation rules fire when the formula evaluates to TRUE, so the formula must evaluate to true when the status is Closed AND at least one required field is blank.

Key Concept

Validation Rule Syntax and Data Quality Enforcement
Estimated Time:1m 30s
Rate this question