Auto-Creation of Tasks Leading up to a Specific Date Field (ie due 150 days Before Date)

Hello, trying to figure out if this is possible within Process Definition or if needs to be coded.

I'm trying to set off a chain of tasks that need to be created based on a date in the future. For example, let's say an annual conference event date field is filled in a specific module.

Using this annual conference event date, I want tasks to be created leading up to the event. For example, 150 days before the conference a task is created to send out invitations, then 100 days leading up to the event a task is created to book a musician, then 50 days leading up to the event a task is created to order all the decor.

So the triggering event for the tasks will be based on a future date.

There are tons of ways to schedule tasks to be created from a date + so many minutes, days, or what have you; but I can't find a way to schedule tasks leading up to a date.

One solution I thought of was to have a separate hidden field that automatically subtracts the maximum days from the event date, then using that calculated date to build a Process Definition.

Has anyone ever needed to created start events based on a future date? How did you go about designing the solution? I'm using Enterprise 7.8. Thank you for any help or insight!

  • I received an idea for a solution from Sugar Support. I'm copying it below in case it is useful for someone else to use. Unfortunately, in my case, there will be between 60 to 80 tasks leading up to an event. The idea suggested below would not a be clean or lean solution for what I need to accomplish.

    Here's an idea if you just have a few tasks leading up to an event date:

    "You will need to create 3 check box fields, (one for each tasks creation you want). This will serve in the Business Rule.

    For sake of simplicity I'll use an example with example time frames. First to accomplish this you would want to use both a process defintion, and a process business rule.

    The process Definition will look something like this:
    https://www.screencast.com/t/FRCQOSrnn1d

    The Business Rule something like this:
    https://www.screencast.com/t/JemtOuY3Htd --> (Of course using 150 days of course)

    So now for the steps in this process (you'll need three separate ones, one for each task, you could try using all 3 in one, but it's been my experience that multiple business rules causes issues).

    The first part just being the start, and using 'When Record is created'.

    The next is a one minute wait timer (but you can use 12 hours if you want (and 12 hours i'll get to later)).

    The action is just the 'Process Business Rule'.

    Parallel Gateway using an 'Exclusive Gateway'. With a default to the wait timer. The two branches of the gateway, one going to the wait event, one going to the action event.

    Wait Event => 12 hours (12 hours + 12 hours = 1 day). I do this to slow it down, to ensure it doesn't skip steps.
    Action => Create related record (Tasks).

    For the Business Rule, you would use the setup I have. The idea is that it checks if the date is under 150 days away. Return the field (disregard the fact I have it set for 10 minutes I named the field then realized I wanted a longer wait). Then the '+' sign to add the action, and set it to update the check box to 'True'.

    The way the process definition will work, is when a record is created it starts the process. From there it will loop through the process defintion until the date is less than 150 days. Once that happens the Business Rule will check the 150 check box. Then the next time it loops through the process defintion it will go 'checkbox = true' and then create tasks."

  • I just discovered the solution for my situation. I was using a Date field when I should have been relying on a Datetime field. When I used a Datetime field, I was able to subtract a constant from the event date.

    So, Datetime Field minus 150 days.

    I tested it using a Process Definition that created a task 5 minutes before the Datetime field. So Datetime field minus 5 minutes. The task executed exactly 5 minutes before the Datetime field event.