Soru

Zorluk: OrtaValidation Rules and Data Quality Enforcement

An administrator is tasked with enforcing data quality standards on a custom object named Partner_Application__c. Business policy requires that whenever the Tier__c picklist field is set to either 'Gold' or 'Platinum', the Tax_Identification_Number__c custom text field must not be left blank. Which validation rule formula correctly enforces this requirement to prevent saving non-compliant records?

  1. AND( OR(ISPICKVAL(Tier__c, 'Gold'), ISPICKVAL(Tier__c, 'Platinum')), ISBLANK(Tax_Identification_Number__c) )Cevap
  2. B
    OR( AND(ISPICKVAL(Tier__c, 'Gold'), ISPICKVAL(Tier__c, 'Platinum')), ISBLANK(Tax_Identification_Number__c) )
  3. C
    AND( OR(ISPICKVAL(Tier__c, 'Gold'), ISPICKVAL(Tier__c, 'Platinum')), NOT(ISBLANK(Tax_Identification_Number__c)) )
  4. D
    AND( Tier__c = 'Gold', Tier__c = 'Platinum', ISBLANK(Tax_Identification_Number__c) )

Cevap

The correct formula is AND( OR(ISPICKVAL(Tier__c, 'Gold'), ISPICKVAL(Tier__c, 'Platinum')), ISBLANK(Tax_Identification_Number__c) ).
The correct formula uses OR(ISPICKVAL(Tier__c, 'Gold'), ISPICKVAL(Tier__c, 'Platinum')) to check if either target tier is selected, combined with ISBLANK(Tax_Identification_Number__c) inside an outer AND function. Because a validation rule fires when the formula evaluates to TRUE, this logic successfully blocks saves when a Gold or Platinum application lacks a tax identification number.

Adım Adım Çözüm

1
Identify the conditions under which the validation rule should trigger an error message.
The rule must trigger when (Tier is 'Gold' OR Tier is 'Platinum') AND the Tax_Identification_Number__c field ISBLANK.
Salesforce validation rules display error messages when the formula expression evaluates to TRUE.
2
Select the correct Salesforce formula functions for picklists and text fields.
Use ISPICKVAL() to evaluate single-select picklist field values, and ISBLANK() to evaluate whether a text field contains no data.
Standard equality operators like '=' cannot be used on picklist fields in standard formula logic without ISPICKVAL, and ISBLANK is preferred over ISNULL for text fields.
3
Combine the logical functions inside an outer AND function.
AND( OR(ISPICKVAL(Tier__c, 'Gold'), ISPICKVAL(Tier__c, 'Platinum')), ISBLANK(Tax_Identification_Number__c) )
This guarantees that both the tier qualification (Gold or Platinum) and the missing data condition (blank Tax ID) must be simultaneously met to throw the error.

Anahtar Kavram

Validation Rule Logic and Picklist Evaluation Functions
Tahmini Süre:1m 15s
Bu soruyu puanla