7

I would like to achieve this by configuration only, my mainly question is about can this formula condition in criteria fires off every year in PB? Basically I am setting up a PB to evaluate Contact's birthday and alert to the Contact Owner 7 days prior to this birthday.

Here is the criteria in the process builder:

TODAY() - (IF(TODAY()>DATE(YEAR(TODAY()),MONTH([Contact].Birthdate),DAY([Contact].Birthdate)), 
DATE(YEAR(TODAY())+1,MONTH([Contact].Birthdate),DAY([Contact].Birthdate)), 
DATE(YEAR([Contact].Birthdate),MONTH([Contact].Birthdate),DAY([Contact].Birthdate)))) = -7

The PB now fires off in first year, but unsure if it will working in next year. Since TODAY()is a system variable, it should be a dynamic condition. But what if the contact record has no manual update in the second year before next coming birthday, will the condition failed which is similar to a formula field does? Any insights?

Thanks and Happy 2017 ahead!

1

1 Answer 1

6

PB is not the way to do this for exactly the reasons you're stating. Unless there's DML performed of some kind on each contact, it won't fire for the contact. I don't know how many contacts you have in your org to deal with, so what solution would be easiest for you to implement isn't simple for me to advise.

There are several different ways to implement this functionality in your org.

  • One would be by creating a recurring Task on each contact (with many contacts, this could be a large task in itself). This solution would miss new contacts as they're created unless you create workflow to auto create the new task on creation (remember that owner's can change).

  • Another way (recommended), would be to create a batch class which is scheduled to run daily (or even weekly) which queries all of your contacts that will have birthdays during the following interval and create tasks for their owners.

  • An additional way of approaching this which would be to do this based on the Account and related contacts if you use PB. It seems this would be a convoluted means of doing this and would become very resource intensive for PB to perform every time an account is accessed to have PB search for all related contacts and their birthdays, then create a Task for any it finds. Note that you'd be touching the same records repeatedly each time an account was accessed if you used this approach (with the right query, may be able to reduce this). You'd still want to do this as a time based Task unless you were confident DML was performed on each Account on a weekly basis.

4
  • There is a fourth option, the "tick tock" workflow rule, which I for no specific reason don't love, but is documented in h&t for this exact use case here help.salesforce.com/…. Agree batch is best.
    – gorav
    Jan 2, 2017 at 0:50
  • @gorav Workflow falls under the last part of the first bullet item. I just didn't go into great detail. As you said, that solution isn't exactly a "great" one.
    – crmprogdev
    Jan 2, 2017 at 13:18
  • Agreed, find the fact that they have an article dedicated to it somewhat surprising.
    – gorav
    Jan 2, 2017 at 16:23
  • 1
    @gorav I too find the tick-tock approach to be confusing and not intuitive upon inspection. Requires good doc/naming conventions within each workflow and prone to easy/inadvertent breakage. Scheduled batch class is at least more amenable to regression testing via testmethods
    – cropredy
    Jan 2, 2017 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .