+ Start a Discussion
sfdc2705sfdc2705 

Validation rule..help pls

Validation Rule

 

If Fields 'Test ID  2','Test ID 3' ,'Test ID  4','Test ID 5'  are filled in and the  Termination  Date is AFTER the  Activation Date, then a rule shall be in place that the  Activation Date field cannot have a value AFTER the Termination Date.

 

what should be the code to achieve this..These all fields are on the same object.

 

Thanks for the help in advance

gautam_singhgautam_singh

Hi,

 


Follow the following Steps to Create this Validation. Mark it as a solution if this works correctly or let me know if you face trouble in this again.Also , Click the Star Icon to Hit Kudos , If this post os helpful for you.

1. Go to Setup > Object > Validation Rules > New
2. Give Validation a Unique Name.
3. In the Formula Section Write this

AND(
(ISBLANK( gautamsingh__Test_ID_2__c )),
(ISBLANK( gautamsingh__Test_ID_3__c )),
(ISBLANK( gautamsingh__Test_ID_4__c )),
(ISBLANK( gautamsingh__Test_ID_5__c )),
(gautamsingh__Termination_Date__c > gautamsingh__Activation_Date__c  )
)

4. Specify the Error Message Activation Date field cannot have a value AFTER the Termination Date. Specify the Location.



Important :

Click on the Star Icon aside if this post provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You

Naveen NelavelliNaveen Nelavelli

if termination date and  activation dates are not mandatory....u need to have one more check 

isBlank(gautamsingh__Termination_Date__c),isBlank(gautamsingh__Activation_Date__c)

inside "And" block