[SalesForce] Validation rule for close won opportunity

I'm trying to create a validation rule that when an opportunity is closed won will not save if the "Contract_Start_Date__c" and "Contract_End_Date_c" is not populated.

I have this:

Contract_Start_Date__c=null || Contract_End_Date__c=null

No syntax errors, but it does not work.

I also have this:

AND(ISPICKVAL(StageName, "Closed Won"),
  (Contract_Start_Date__c=null || Contract_End_Date__c=null))

No syntax errors there either, but it did not work either. 🙁

Any advice to correct these?

Best Answer

Use ISBLANK() formula instead of comparing to null.

AND(ISPICKVAL(StageName, "Closed Won"), ISBLANK(Contract_Start_Date__c) || ISBLANK(Contract_End_Date__c))
Related Topic