Soru

Zorluk: ZorValidation Rules and Data Quality Enforcement

An administrator at a medical device company is tasked with enforcing data quality on the custom object Inspection_Log__c. The compliance team mandates the following requirements for record updates:

1. When an existing Inspection_Log__c record has its Inspection_Stage__c picklist value changed to "Failed", the Failure_Reason__c text field must not be left blank.
2. The validation rule must NOT execute when creating new records, as initial automated intake allows a temporary blank reason.
3. The rule must NOT execute during subsequent updates if the Inspection_Stage__c field was already set to "Failed" prior to the current edit.

Which validation rule formula correctly enforces these business requirements?

  1. AND( NOT(ISNEW()), ISCHANGED(Inspection_Stage__c), ISPICKVAL(Inspection_Stage__c, "Failed"), ISBLANK(Failure_Reason__c) )Cevap
  2. B
    AND( NOT(ISNEW()), ISPICKVAL(Inspection_Stage__c, "Failed"), ISBLANK(Failure_Reason__c) )
  3. C
    AND( ISCHANGED(Inspection_Stage__c), TEXT(Inspection_Stage__c) = "Failed", Failure_Reason__c = "" )
  4. D
    AND( NOT(ISNEW()), ISPICKVAL(PRIORVALUE(Inspection_Stage__c), "Failed"), ISBLANK(Failure_Reason__c) )

Cevap

The formula AND( NOT(ISNEW()), ISCHANGED(Inspection_Stage__c), ISPICKVAL(Inspection_Stage__c, "Failed"), ISBLANK(Failure_Reason__c) ) correctly satisfies all specified requirements.
The correct formula combines NOT(ISNEW()), ISCHANGED(Inspection_Stage__c), ISPICKVAL(Inspection_Stage__c, "Failed"), and ISBLANK(Failure_Reason__c) inside an AND statement. This ensures the rule only fires when an existing record is edited, the stage field itself is changed during the save, the new stage value is 'Failed', and the failure reason field has been left empty.

Adım Adım Çözüm

1
Exclude new record creation
Use NOT(ISNEW()) to ensure the rule only evaluates existing record edits.
Requirement 2 states the rule must not execute upon record creation.
2
Isolate stage changes
Include ISCHANGED(Inspection_Stage__c) in the logical AND condition.
Requirement 3 specifies the rule should not re-trigger on subsequent edits if the stage was already 'Failed' prior to the current save.
3
Validate target picklist value
Use ISPICKVAL(Inspection_Stage__c, "Failed") to test the new picklist state.
Requirement 1 targets transitions specifically entering the 'Failed' stage.
4
Check required text field population
Use ISBLANK(Failure_Reason__c) to detect missing field values accurately.
ISBLANK is the Salesforce best-practice function for evaluating null or empty text values.

Anahtar Kavram

Validation Rule Logic & Transition Checking with ISCHANGED, ISNEW, and ISBLANK
Bu soruyu puanla