Soru

Zorluk: OrtaValidation Rules and Data Quality Enforcement

An administrator needs to enforce a data quality requirement on the Contact object. Whenever a contact's custom picklist field `Contact_Status__c` is set to 'Active', the `Tax_Identification_Number__c` text field must not be left blank. Which validation rule formula correctly prevents saving the record when this requirement is violated?

  1. AND( ISPICKVAL(Contact_Status__c, 'Active'), ISBLANK(Tax_Identification_Number__c) )Cevap
  2. B
    AND( Contact_Status__c = 'Active', Tax_Identification_Number__c = NULL )
  3. C
    OR( ISPICKVAL(Contact_Status__c, 'Active'), ISBLANK(Tax_Identification_Number__c) )
  4. D
    AND( ISPICKVAL(Contact_Status__c, 'Active'), NOT(ISCHANGED(Tax_Identification_Number__c)) )

Cevap

The correct formula is AND( ISPICKVAL(Contact_Status__c, 'Active'), ISBLANK(Tax_Identification_Number__c) ). Validation rules trigger an error when the formula evaluates to TRUE. Combining ISPICKVAL for picklist evaluation and ISBLANK for text field null checking within an AND statement ensures the error only fires when the status is Active and the required field is missing.
The formula correctly uses ISPICKVAL to evaluate the custom picklist value and ISBLANK to verify whether the text field is empty. Enclosing both conditions within the AND function ensures that the validation error fires only when the contact is set to 'Active' and the Tax Identification Number is missing.

Adım Adım Çözüm

1
Identify picklist function requirements
Use ISPICKVAL(Contact_Status__c, 'Active') to test picklist values in validation rule syntax.
Standard equality operators cannot directly evaluate picklist fields in standard formula fields unless converted or wrapped in ISPICKVAL.
2
Identify blank value checking requirements
Use ISBLANK(Tax_Identification_Number__c) to determine if the text field lacks data.
ISBLANK is the recommended function in Salesforce for checking null or empty text field values.
3
Combine logical conditions
Wrap both functions in an AND() logical operator so the formula evaluates to TRUE only when both conditions occur simultaneously.
Validation rules display an error message and block save operations when the formula condition evaluates to TRUE.

Anahtar Kavram

Validation Rule Logic and Null Value Handling
Tahmini Süre:1m 30s
Bu soruyu puanla