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
Pradeep RajuPradeep Raju 

Auto Populate date to +2 yrs of current selected date

Hi All,

If i select a date in datefield while inserting/updating record.I want a field to populated with +2 yrs of selected date.

Can we achieve this with formula field ??
Gonzalo AbrunaGonzalo Abruna
Yes, this can be achieved with a formula field. Create a formula field with a value like the following:


DATE(YEAR(your_field__c) + 2,month(your_field__c),day(your_field__c))
Sri549Sri549
Hello Pradeep,
I have gone thorugh your requiment i didnt understand your requirment perfectly .
my doubt is when we select any date from date field,you want to add +2 yrs to that field itself or creating other  field in the formuale and auto populating it.
if you want to do another field and add +2 yrs in selected date and showing up that in other field go for formulae field and use this formulae yourdatefield + 728.Or else go for workflow and update the same field in which you are selecting the date field value.

Hit Kudos if this 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,
Srinivas
SFDC Certified Developer
Pradeep RajuPradeep Raju
Hi Srinivas,

I got the requirement.

Thanks,
Pradeep,
Consulting Firm Employee.