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
Sushma Iyer 3Sushma Iyer 3 

Start Date and End Date of Child record need to be with the range of Start Date and End Date of Parent record

Hi All,

We have a requirement wherein the Start Date of the Child Record can be only 6 months less than the Start Date of the Parent Record.

Also, the End Date of the Child Record can be only 6 months more than the End Date of the Parent Record.

Please help me create the Validation Rule for this.

Thank You for all the Help in Advance!
Raquib SFRaquib SF
Hello Sushma,

The below should do
(Account.CreatedDate  >  ADDMONTHS(CreatedDate, 6) )
 || ( Account.CreatedDate  <  ADDMONTHS(CreatedDate, 6) )

Please let me know if this solves your issue.

Thanks!
Sushma Iyer 3Sushma Iyer 3
Hi Raquib SF,

I tried the below based on your Validation Rule but it's not working :

( Parent_Marketing_Campaign__r.Start_Date__c > ADDMONTHS( Start_Date__c , 6) )
|| ( Parent_Marketing_Campaign__r.Start_Date__c < ADDMONTHS(Start_Date__c, 6) )

For example if my Parent Marketing Campaign Start Date says: 01/06/2019 (1st June 2019)

So my Child Marketing Campaign Start Date should be allowed to enter anything between 1st December 2018 to 1st June 2018

But if anything before 1st December 2018 should not be allowed to be entered.

Thanks so much for all the help in advance...!