BPM - How to use a custom 'delay period' to calculate a reminder date ?

Hello,

I am facing an issue and I don't find any easy way to solve my problem.

I want to know how to, using BPM (no custom code), calculate a reminder date depending on 2 other fields of my record

  • the due date
  • the reminder delay (int value ; number of day for this specific record) 

When I use the BPM date calculation feature, I don't find any easy way to set the reminder date as "due date - reminder delay".

And of course, I don't want to set multiple condition to say "if delay = 1 then ...else if delay = 2 etc." because the delay can be really differents.

Of course, a code solution is easy, but it seems a basic requirement, so I want to be sure that I am not missing something.

Many thanks for your time and your help,

Fred

  • Hi ,

    SugarBPM does not have a way to adjust date values dynamically from another field value. You can only do that via constants (e.g. 1 business day, 2 weeks, etc.).

    I think the best solution to stay true to your no code requirement is to use Sugar Logic. With your use case, I was able to achieve this with a datetime (with a behavior I consider to be minor) or a date field. I used the Tasks module in my scenario since it already has a Due Date field (date_due, datetime value).

    I created the following fields:

    • Reminder Offset (reminder_offset_c) - Integer field to represent the number of days to set the reminder
    • Custom Date (custom_date_c) - Date field to represent a due date with no time value
    • Reminder Date & Time - Datetime field to represent the appropriate reminder date & time by taking the Due Date field and subtracting the number of days stored in the reminder offset. This field is calculated with the following formula:
      addDays($date_due,negate($reminder_offset_c))
    • Reminder Date - Date field to represent the appropriate reminder date by taking the Custom Date field and subtracting the number of days stored in the reminder offset. This field is calculated with the following formula:
      addDays($custom_date_c,negate($reminder_offset_c))

    The only quirk is that if the due date & time doesn't fall exactly on a 15-minute interval, the formula will set the reminder time to the prior 15-minute interval. I think in the context of reminders, that is an acceptable variance but if you needed an exact difference, you would have to go with a code solution to properly set the reminder time.

    Here is a sample task record with all fields populated and the calculated reminder times:

    By using Sugar Logic for this solution, the reminder times will be recalculated on any save of the record (whether saved by SugarBPM, a user, etc.) so you can ensure that the reminder will always be relevant to the the desired offset and current due date.

    Chris

  • Hi ,

    Yes, I was also thinking about that path. I was just hoping that I missed something inside the BPM feature that can handle my expectations.

    But I will do it with formula / SugarLogic.

    Many thanks.

    Have a good day