function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PCRecyclerPCRecycler 

Validation Rule Help

I'm trying to create a validation rule the checks two date fields to make sure they match as long as one of them has been filled.  If the custom field is empty, nothing happens, but if the custom field has a date in it, the date is checked with the "CloseDate" field.

"CloseDate" must equle "datasynchqbod__QB_Transaction_Date__c" but only if datasynchqbod__QB_Transaction_Date__c has been filled in.

The "datasynchqbod__QB_Transaction_Date__c" is defaulted to be blank.  Once the Opportunity is moved to closed Won the opportunity is synced with an external system and datasynchqbod__QB_Transaction_Date__c gets a date entered into it.  We need that date to stay synced with "CloseDate" going forward.  The two fields must be equal once something is entered.

Thanks so much for your help,

JEremy

Best Answer chosen by Admin (Salesforce Developers) 
super developersuper developer

If(datasynchqbod__QB_Transaction_Date__c!=null&&datasynchqbod__QB_Transaction_Date__c!=closeddate)

 

Then display error.