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
Vijaya Kumar RegantiVijaya Kumar Reganti 

Validation help

Hi Friends,

 

I have Term__c as parent and Stats__c as child .

 

On the Term__c object I have Allow_Update_for_Past_Dates__c and End_Date__c fields.

 

My requirement is to allow the user to save the Stats__c record whent the Allow_Update_for_Past_Dates__c checkbox is checked or End_Date__c is in future. If these two coditions failed, then the stats record should not be saved.

 

Please help me to achieve this.

 

Thanks,

 

Vijay

Best Answer chosen by Admin (Salesforce Developers) 
Vinita_SFDCVinita_SFDC

Hello,

 

Create this validation rule on Stats__c

IF(NOT(Term__c.Allow_Update_for_Past_Dates__c = true && Term__c.End_Date__c > Today()))

All Answers

Vinita_SFDCVinita_SFDC

Hello,

 

Create this validation rule on Stats__c

IF(NOT(Term__c.Allow_Update_for_Past_Dates__c = true && Term__c.End_Date__c > Today()))

This was selected as the best answer
sfdcfoxsfdcfox
Vinita, almost...

AND(NOT(Allow_Update_For_Past_Dates__c), End_Date__c <= TODAY())