Question

Difficulty: MediumValidation Rules and Data Quality Enforcement

A Salesforce administrator is configuring validation rules on a custom object named Asset_Maintenance__c to enforce data quality standards. Match each business validation requirement with its corresponding validation rule formula syntax.

  • Require the Resolution_Summary__c field to be populated only when the Status__c picklist field is changed to 'Completed'.AND(ISCHANGED(Status__c), ISPICKVAL(Status__c, "Completed"), ISBLANK(Resolution_Summary__c))
  • Validate that the custom text field Serial_Number__c conforms to a format of exactly two uppercase letters followed by six numerical digits.AND(NOT(ISBLANK(Serial_Number__c)), NOT(REGEX(Serial_Number__c, "^[A-Z]{2}[0-9]{6}$")))
  • Prevent users from entering a Completion_Date__c that occurs in the future whenever the Status__c picklist field is set to 'Completed'.AND(ISPICKVAL(Status__c, "Completed"), Completion_Date__c > TODAY())
  • Require Manager_Approval_Notes__c when updating an existing record if the Discount_Percentage__c exceeds 20%.AND(NOT(ISNEW()), Discount_Percentage__c > 0.20, ISBLANK(Manager_Approval_Notes__c))

Answer

The correct pairings match each validation scenario to its proper formula logic: (1) Requiring resolution summary on status change maps to AND(ISCHANGED(Status__c), ISPICKVAL(Status__c, 'Completed'), ISBLANK(Resolution_Summary__c)); (2) Formatting serial numbers maps to AND(NOT(ISBLANK(Serial_Number__c)), NOT(REGEX(Serial_Number__c, '^[A-Z]{2}[0-9]{6}$'))); (3) Restricting future completion dates maps to AND(ISPICKVAL(Status__c, 'Completed'), Completion_Date__c > TODAY()); (4) Requiring manager notes on updates maps to AND(NOT(ISNEW()), Discount_Percentage__c > 0.20, ISBLANK(Manager_Approval_Notes__c)).
Each business requirement relies on standard Salesforce formula functions: ISCHANGED() checks if a picklist field was altered in the current transaction; REGEX() validates string patterns when negated with NOT(); date logic compares custom date fields against TODAY(); and NOT(ISNEW()) ensures validation logic applies exclusively to existing record edits rather than initial inserts.

Step-by-Step Solution

1
Analyze requirement 1 (Status change to Completed requires Resolution Summary).
Identify that detecting a field state change requires ISCHANGED(), testing picklist values requires ISPICKVAL(), and checking missing values requires ISBLANK(). Combining these in AND() triggers the error when the condition is violated.
Validation rules evaluate to TRUE to block saving and display an error message.
2
Analyze requirement 2 (Serial number regex pattern validation).
Use REGEX(Serial_Number__c, '^[A-Z]{2}[0-9]{6}$') wrapped in NOT() so that non-matching formats return TRUE, firing the validation error.
REGEX tests string structure, and wrapping with NOT ensures non-conforming strings trigger the error.
3
Analyze requirement 3 (Preventing future completion dates).
Evaluate Completion_Date__c > TODAY() combined with ISPICKVAL(Status__c, 'Completed').
Date comparisons evaluate directly against system functions like TODAY().
4
Analyze requirement 4 (Existing record updates with discount threshold).
Combine NOT(ISNEW()) to bypass newly created records, Discount_Percentage__c > 0.20 for the threshold, and ISBLANK(Manager_Approval_Notes__c) to enforce mandatory notes.
ISNEW() evaluates to TRUE during record insertion; wrapping it in NOT() isolates update operations.

Key Concept

Validation Rules and Data Quality Enforcement
Rate this question