A Salesforce administrator is implementing data quality controls across various objects in an organization. Match each business requirement with the correct validation rule formula expression designed to enforce that data quality requirement.
- Prevent users from modifying the Discount Percentage field after an Opportunity has already reached the 'Closed Won' stage.AND(ISPICKVAL(PRIORVALUE(StageName), "Closed Won"), ISCHANGED(Discount_Percentage__c))
- Enforce that a custom Tax Identification Number field matches a specific format of two uppercase letters followed by six numerical digits whenever it is populated.AND(NOT(ISBLANK(Tax_ID__c)), NOT(REGEX(Tax_ID__c, "[A-Z]{2}[0-9]{6}")))
- Require the Phone field to be populated whenever a Lead record rating is set to 'Hot'.AND(ISPICKVAL(Rating, "Hot"), ISBLANK(Phone))
- Prevent a Project Target Completion Date from being set to a date prior to the record's creation date.Target_Completion_Date__c < DATEVALUE(CreatedDate)
Answer
Matching pairings: Preventing modifications to Discount Percentage after Closed Won matches AND(ISPICKVAL(PRIORVALUE(StageName), 'Closed Won'), ISCHANGED(Discount_Percentage__c)); Validating Tax ID format matches AND(NOT(ISBLANK(Tax_ID__c)), NOT(REGEX(Tax_ID__c, '[A-Z]{2}[0-9]{6}'))); Requiring Phone for Hot Leads matches AND(ISPICKVAL(Rating, 'Hot'), ISBLANK(Phone)); Enforcing Target Completion Date after CreatedDate matches Target_Completion_Date__c < DATEVALUE(CreatedDate).
Each validation formula expression correctly models the specific business requirement using Salesforce formula functions: PRIORVALUE and ISCHANGED monitor field edits relative to previous values; REGEX combined with NOT(ISBLANK) validates pattern compliance; ISPICKVAL combined with ISBLANK enforces mandatory inputs; and DATEVALUE normalizes DateTime fields for comparison.
Step-by-Step Solution
Key Concept
Salesforce Validation Rule Formula Functions and Data Quality Enforcement