0

I have created a custom object "Assigned tasks" that works like tasks such that it has due date, subject, priority e.t.c. This custom object "Assigned tasks" is a child object to case object. Case object has a date/time field called "Event start date". I want the system to keep checking the due date of the assigned task and the value in Event start date on the case level. when there are only 45 days left in the event start date and status of task is pending, it should send an email alert/reminder to the assignee of the task that they have to complete the task.

I created a formula field(Checkbox) on the assigned task object:

IF(AND(OR(TEXT(Status__c) ='Pending', TEXT(Status__c) = 'Waiting on Someone'), DATEVALUE(Case__r.Event_Start_Date__c -45) = TODAY()),true, false)

Then in process builder , I am trying to check if the formula above/checkbox is true, it sends an email alert.

The issue is that the checkbox does get selected 45 days prior to event start date but it does not trigger the process builder to send an email alert.Need help.

0

That's not how scheduled actions work (workflow or process builder). Instead, you need to set the criteria not including the date:

OR(ISPICKVAL(Status__c,"Pending"),ISPICKVAL(Status__c,"Waiting on someone"))

Make sure you check the advanced option for "Do you want to execute the actions only when specified changes are made to the record?"

Next, add a formula to your object to get the date:

Case__r.Event_Start_Date__c

Finally, in the scheduled action area, specify "45 Days Before Event Start Date".

As a special note, if the case's value changes, the flow won't "notice" this unless you also update the child records. You may want to set up a separate process to do this to make sure the dates are updated appropriately.

  • Thanks for the reply. I see what you are saying. However, I wonder if the existing task records that are already in 'Pending' or 'Waiting on someone' status would still trigger this? – Student Mar 14 '19 at 16:15
  • @Student No, it would only affect future records. Again, this is how the platform works; PB can only fire when a record is created or modified. – sfdcfox Mar 14 '19 at 16:16
  • so does that mean I will have to write Batch Apex Scheduler code? – Student Mar 14 '19 at 16:27
  • @Student Typically, you should be able to use the Data Loader to touch the records and queue them. Also, a scheduler would be pointless, since you'd only need it for at most 45 days. – sfdcfox Mar 14 '19 at 16:30
  • 1
    @Student You'll want to read this article and related links. In the case of existing records, you have to update them to not match the criteria, then again to match the criteria. For new records (e.g. 60 days out), the record is placed in the queue, and at the appropriate time, the alert would be sent out. The help link I just linked to explains in more detail. – sfdcfox Mar 14 '19 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.