Home

Friday, 30 December 2022

sfdc-learn #6 Validation Rule to fire when appointment date selected as last Friday of every month.

 If we have requirement to user should not select last friday of every month as appointment date and if   selected then show appropriate message on record in salesforce. This we can achieve using custom   validation rule.  Following validation rule condition we can use:

  • Validation Rule Conditions:

        (WEEKDAY( Appointment_date__c ) = 6 ) && 

        ((DATE(YEAR(ADDMONTHS( Appointment_date__c , 1)) ,  
                      MONTH(ADDMONTHS( Appointment_date__c ,1)) ,
                     1) -  Appointment_date__c ) <= 7 )


  • Validation Rule:



  • Test Result:
 
























No comments:

Post a Comment