Skip to main content

Modify Engagement Plan Templates to work backward from a specified future date

 

Hi all—just wanted to share this tip as I know the inability of "stock" Engagement Plan Templates to work backward from a future date is something that kept me from using them for a long time, and I think is an issue other folks on the Hub run into as well. Our need for this feature eventually got to the point where I just decided to think it through, and it was actually pretty easy to set up declaratively and is *almost* as easy to use as the standard process for setting up a plan.

  1. Create a custom date field "Final Date" on the Engagement Plan Template object and add to layout
  2. Create a custom number field "Days Before" on the Engagement Plan Task object and add to layout
  3. Create a (or modify your existing) Process that's triggered when a Task is created *edited to add both sets of criteria so the process won't fail if a non-EP Task is created*
    1. Criteria to meet: Task > Engagement Plan Task is not null, AND Task > Engagement Plan Template is not null
    2. Action to take if met: Update the Task that triggered the process and set the due date to Engagement Plan "Final Date" minus Engagement Plan Task "Days Before" value if there is a "Days Before" value specified. Here's the formula: IF(NOT(ISBLANK([Task].npsp__Engagement_Plan_Task__c.Days_Before__c )),[Task].npsp__Engagement_Plan__c.Finish_Date__c - [Task].npsp__Engagement_Plan_Task__c.Days_Before__c ,

      [Task].ActivityDate )

  4. Set up an Engagement Plan Template as you normally would, and leave "Days After" blank for any Tasks you want to set based on a future date. Once it's done, open up that template's record, and look at the related list for the Engagement Plan Tasks you want to update. Edit these records to add your preferred "Days Before" value. It's one step more complicated than using the visualforce page, but really very straightforward.
  5. Create a new Engagement Plan, and make sure to set a "Finish Date" value.
  6. When the Tasks are automatically created, Process Builder checks to see if they are related to an Engagement Plan Task with a value in "Days Before," and then updates the due date based on that value and the "Finish Date" value of the Engagement Plan

Notes:

  • I haven't thoroughly tested this or played around to see how dependent Tasks are handled
  • I suspect if you use email alerts when the tasks are created they'll have the old value (TODAY if left blank) rather than the value defined in Process Builder
  • This might be a cool #SprintIdea to implement a little more robustly and include a "days before" value in the VF page...
  • #PUBCrawlTip
1 commentaire
  1. 19 févr. 2019, 15:08
    This is fantastic. Thanks so much for sharing with the community! Would you consider adding this to the Solution Exchange?
0/9000