Soru

Zorluk: ZorValidation Rules and Data Quality Enforcement

A Salesforce administrator at a global logistics firm is configuring data quality controls on the custom object Shipment_Manifest__c. Match each business requirement with the formula pattern that correctly implements the logic while adhering to Salesforce formula evaluation best practices.

  • Prevent edits to Delivery_Notes__c unless Status__c is currently set to 'In Transit'.AND( ISCHANGED(Delivery_Notes__c), NOT(ISPICKVAL(Status__c, "In Transit")) )
  • Require Driver_License_Number__c to be populated whenever Carrier_Type__c is set to 'Internal'.AND( ISPICKVAL(Carrier_Type__c, "Internal"), ISBLANK(Driver_License_Number__c) )
  • Prevent users from decreasing the Declared_Value__c on existing records, while allowing any initial value upon record creation.AND( NOT(ISNEW()), ISCHANGED(Declared_Value__c), Declared_Value__c < PRIORVALUE(Declared_Value__c) )
  • Enforce a 5-digit numeric format on Postal_Code__c whenever it is created or updated, ensuring blank values do not trigger false positives if optional.AND( OR(ISNEW(), ISCHANGED(Postal_Code__c)), NOT(ISBLANK(Postal_Code__c)), NOT(REGEX(Postal_Code__c, "^[0-9]{5}$")) )

Cevap

Each business requirement is matched with its corresponding formula pattern based on standard Salesforce formula function mechanics: restricting Delivery_Notes__c edits matches the pattern using ISCHANGED and ISPICKVAL status verification; mandatory Driver_License_Number__c matches the ISPICKVAL and ISBLANK pattern; restricting Declared_Value__c decreases matches the NOT(ISNEW()) and PRIORVALUE comparison pattern; and Postal_Code__c formatting matches the REGEX pattern combined with ISBLANK and context checks.
Matching each business requirement requires selecting functions aligned with field data types and transaction contexts. ISCHANGED and PRIORVALUE apply to modified existing values, ISNEW isolates record creation context, ISPICKVAL handles picklist evaluation, and combining ISBLANK with REGEX prevents null-handling errors during pattern enforcement.

Adım Adım Çözüm

1
Analyze status-restricted field modification requirements.
Edits to Delivery_Notes__c must trigger a validation error if Status__c is not 'In Transit'.
ISCHANGED(Delivery_Notes__c) paired with NOT(ISPICKVAL(Status__c, 'In Transit')) captures modifications attempted outside the permitted picklist status.
2
Analyze conditional field population rules.
Driver_License_Number__c must evaluate true (error state) when blank if Carrier_Type__c equals 'Internal'.
ISPICKVAL assesses picklist values safely without text cast issues, and ISBLANK accurately detects empty text inputs.
3
Analyze field value reduction restrictions on existing records.
The rule must trigger only on existing record updates where the newly submitted value is less than the prior saved value.
NOT(ISNEW()) prevents execution during record creation, while PRIORVALUE(Declared_Value__c) provides the historical comparison baseline.
4
Analyze pattern format validation with null handling.
Regex format matching should execute on creation or edit, but skip evaluation when optional fields are left blank.
NOT(ISBLANK(Postal_Code__c)) guards against false positive validation errors on empty optional inputs while REGEX enforces exact 5-digit formatting.

Anahtar Kavram

Validation Rule Function Mechanics and Data Quality Guardrails
Bu soruyu puanla