ShowAll Questionssorted byDate Posted
Hermes Gomez

# Email Alert before someone turns 40

Hi Experts,

I need to set up an email notification that will alert me when one of my contacts is turning 40!

i want it to be SPECIFICALLY 65 days prior to that date. i have an AGE field that has a formula to it of :

IF(MONTH(TODAY())>MONTH(Birthdate),YEAR(TODAY())-YEAR(Birthdate),IF(AND(MONTH(TODAY())=MONTH(Birthdate),DAY(TODAY())>=DAY(Birthdate)),YEAR(TODAY())-YEAR(Birthdate),(YEAR(TODAY())-YEAR(Birthdate))-1))

That formula brings me back the actual age of the contact from the persons Birthdate.

I know that to set up an email alert you have to do the Workflow and then the Email template.

But how do i set up an alert to trigger prior to someones birthdate etc.

Andrew Echevarria
Maybe you can make a class that checks for all Contacts everyday for this case, and alerts you if any meet the criteria. Then, you can make a schedule Apex class to schedule this class to run everyday. Would this meet your needs?
Hermes Gomez
I think this could be the solution.

Im just starting with salesforce, How is this done?

RD@SF
Hi Hermes,

Why dont you do the following.
1. On the record create or when the birthdate is populated.
2. Calculate the year in which the person will turn 40,
if birth date is (1/1/1990)
say if the year(birthday) is 1990, after 40 years he would turn 40.
Hence year becomes 2030, at the date (1/1/2030)  a contact is going to turn 40.
Use this date and update that in a date field. say "turn 40 date"
3. Write another workflow to trigger when this new date field is populated and schedule a time trigger i.e. 65 days before the "turn 40 date",

And thats it.

Hope it helps
RD
RD@SF
Hi Hermes,

let me know if you need any assitance

Regards
RD
Hermes Gomez
Well i cant do that for all my contacts. theres too many already.
RD@SF
Hm I guess you are right, if you set something like this, you would have to do a data update using data loader.