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
gitRdonegitRdone 

Automatically send a birthday greeting to contacts on the day of their birthday

I'm trying to set-up a workflow to simply send a birthday greeting to contacts on the day of their birthday.
 
Initially I created a custom "Next Birthday" contact field -- Calculates the date of the contact's next birthday (based on Birthdate field).
 
Then, I set up a workflow to trigger when TODAY()=Next_Birthday__c...along with workflow actions to send an email and a task to record the activity.

 

However, SFDC support explains that only actions (adding or updating records) can trigger a workflow. 

 

How can I use changes in the current date as a trigger for workflows? Open to any work-arounds.

werewolfwerewolf

The problem with your criteria there is that you're assuming that workflow re-evaluates itself at periodic intervals, but as you've correctly ascertained, that's not how it works.

 

What you should probably do is make a workflow where Next_Birthday__c is not null, and then set a time trigger 0 days before Next_Birthday__c to send your email.  This workflow will not apply retroactively, but for any new contacts you add from that point forward, you'll send them that email.  Note that time based triggers are not currently recurring either, so to get it to fire for the following year you'd have to null out Next_Birthday__c and reset it.

werewolfwerewolf
Oh, also, you might look into using the AppExchange application CronKit.  That might help.
justin hjustin h

Pretty common question, CronKit looks like it can solve a lot of problems. I already created the custom field for next birthday and the workflow with the time based trigger but your last comment about the workflow not resetting really got me thinking... thinking that the workflow will only work this year :-/

 

So I just installed the CronKit.

I am a noob to Apex so can you elaborate a little on the APEX needed to create a batch to wipe the next_birthday_c field so that the workflow will reset and trigger again come next year. I figure run the batch every 30 days and wipe out all next birthdays that occur in the past.

 

Otherwise the user would have to go in to the record open it and save it to have the next_birthday_c field update automaticaly and retrigger the workflow action (correct?)

bhanu reddy 24bhanu reddy 24
can you plzz send a program