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}$")) )
Answer
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.
Step-by-Step Solution
Key Concept
Validation Rule Function Mechanics and Data Quality Guardrails