You need to sign in to do that
Don't have an account?
hylim12
calculate age based on DOB dynamically Every Year
Hi,
i have a formula field to calculate my contact's age based on DOB. I would like know, will Salesforce auto update the age field yearly to change the age?
Meaning that, the moment i create a contact with DOB = 1 Dec 1980 and my formula field will calculate the age as 33 (2013 - 1980). When reach 2014, is there a way to auto update the age to 34 (2014-1980) and subsequenctly to 35,36,37.. without editing the contact?
Thanks.
@hylim12,
The formula (any formula) will be evaluated every time the record is queried. The formula result is not actually stored in the record. This means that the formula will be correct now and always. There is no need to "update" the field.
If this helps, please mark it as a solution, and give kudos (click on the star) if you think I deserve them. Thanks!
-Glyn Anderson
Certified Salesforce Developer | Certified Salesforce Administrator
All Answers
Create a formula field with return type Number with decimal point 0 and put this below formula,
YEAR(TODAY()) - YEAR(DateOfBirth__c)
Where DateOfBirth__c is your Date field...
Hope this may helpful to you..!
does it mean that this formula will auto evaluate every year automatically?
Yes it will work...
if i have formula like this :
will it auto evaluate it every year? how frequent salesforce will evaluate this formula? i have like 122512 contact all with different birthdate, will salesforce check every second and change the age accordingly?
TEXT(YEAR(TODAY() ) - YEAR( YOUR_DATE_OF_BIRTH_API ))
Only YEAR will have auto calculation? how about until MONTH?
@hylim12,
The formula (any formula) will be evaluated every time the record is queried. The formula result is not actually stored in the record. This means that the formula will be correct now and always. There is no need to "update" the field.
If this helps, please mark it as a solution, and give kudos (click on the star) if you think I deserve them. Thanks!
-Glyn Anderson
Certified Salesforce Developer | Certified Salesforce Administrator