Skip to main content
I have a date field First_Check_Date_c  and I would like a Validation rule so that when the First Check Date is changed (pushed out) they would need to choose a reason from the picklist Push_Reasoning_c. 
5 answers
  1. Mar 4, 2014, 9:15 PM
    For that you will need a Workflow Rule + Field Update which records the # of times the Date has been pushed forward . If the number recorded is already 1 and if this the 2nd time then we may need an another VR to fire.

     

    So here you go:

     

    Creating a Number Field
    • Field Label : # Of Times Date Pushed

    • Field Name : No_Of_Times_Date_Pushed

    • Field Type : Number

    • Default Value : 0

    • Note : You do not need to add the New Field to the Page Layout

     

    Setting up the Workflow Rule + Field Update
    1. Go to Setup | Create | Workflows & Approvals | Workflow Rules

    2. Click New Rule

    3. Click Next

    4. Evaluation Criteria : created and every time it's edited

    5. Rule Criteria : formula evaluates to true

    6. Formula : 

      AND(

      ISCHANGED(First_Check_Date__c),

      PRIORVALUE(First_Check_Date__c) < First_Check_Date__c,

      )

    7. Click Save & Next

    8. From under Immediate Workflow Actions, click Add Wokflow Action to select Field Update

    9. Select the Field to Update : # Of Times Date Pushed

    10. Select Use a Formula to Set the New Value

    11. Formula :  No_Of_Times_Date_Pushed__c + 1

    12. Click Save

    13. Click Done

    14. Click Activate

    Setting up the new VR

     

    AND(

    ISCHANGED(First_Check_Date__c),

    PRIORVALUE(First_Check_Date__c) < First_Check_Date__c,

    No_Of_Times_Date_Pushed >= 1,

    ISBLANK(TEXT(Push_Reasoning_2__c))

    )

0/9000