Soru

Zorluk: ZorValidation Rules and Data Quality Enforcement

An administrator at Cloud Kicks is building a validation rule on the custom object Service_Contract__c to maintain high data quality standards. The requirement states that whenever an existing service contract record is updated and its custom picklist field Status__c is changed to 'Approved', the custom currency field Total_Contract_Value__c must not be left blank and must be equal to or greater than $50,000. Which formula expression correctly enforces this requirement while properly accounting for null values?

  1. AND( NOT(ISNEW()), ISCHANGED(Status__c), ISPICKVAL(Status__c, "Approved"), OR(ISBLANK(Total_Contract_Value__c), Total_Contract_Value__c < 50000) )Cevap
  2. B
    AND( NOT(ISNEW()), ISCHANGED(Status__c), ISPICKVAL(Status__c, "Approved"), Total_Contract_Value__c < 50000 )
  3. C
    AND( ISNEW(), ISPICKVAL(Status__c, "Approved"), OR(ISBLANK(Total_Contract_Value__c), Total_Contract_Value__c < 50000) )
  4. D
    AND( NOT(ISNEW()), PRIORVALUE(Status__c) = "Approved", OR(ISBLANK(Total_Contract_Value__c), Total_Contract_Value__c < 50000) )

Cevap

The correct formula is AND( NOT(ISNEW()), ISCHANGED(Status__c), ISPICKVAL(Status__c, "Approved"), OR(ISBLANK(Total_Contract_Value__c), Total_Contract_Value__c < 50000) ).
The correct formula evaluates to TRUE (blocking the save with an error) whenever an existing record is edited, the Status__c field is changed to 'Approved', and the Total_Contract_Value__c is either unpopulated (ISBLANK) or less than 50,000.

Adım Adım Çözüm

1
Determine the record lifecycle scope
Use NOT(ISNEW()) to ensure the rule triggers only during record updates on existing records.
The requirement specifies that the validation rule applies when an existing contract record is updated.
2
Detect field status changes
Combine ISCHANGED(Status__c) and ISPICKVAL(Status__c, 'Approved').
This confirms that the Status__c picklist was actively changed to 'Approved' during the edit action.
3
Enforce data quality and null handling for the numerical value
Use OR(ISBLANK(Total_Contract_Value__c), Total_Contract_Value__c < 50000) inside the AND statement.
Validation rules fire when the formula evaluates to TRUE. To enforce that the field is not blank and is at least 50,000, the error condition must trigger if it IS blank OR if it is less than 50,000.

Anahtar Kavram

Salesforce Validation Rule Formula Functions and Null Handling
Tahmini Süre:1m 30s
Bu soruyu puanla