Round up/down datetime field with BPM or Formula

We have a requirement that I am really struggling with so all help welcome. Using the BPM I am adding SLA targets using Business Hours to our Tasks. This has been nice and easy to achieve using Business Rules and Processes adding onto the Datetime Start field we are using.

We have a need whereby if a Task is received after a certain time then rather than be 4 business hours it will be 14:00 the following day. I can add the hours but utilising a suite of Business rules to work out how many Business Hours to add.

The bit that I cannot figure out is how to round up/down to the nearest hour.

Has anyone been able to achieve this or similar please?

Thanks

*No code changes please. I would like to achieve if at all possible without impacting the core code.

  • OKay, here is no-code configuring for the task
    "anything raised before 12:00 would have a Due Date of 16:00 (4bh) that day and anything after would be 16:00 the next business day"

    I see that the DateTime format is d/m/Y H:m

    1. The Busness Center opens every workday from 12:00 to 16:00, Sun and Sat are dayoffs

    2.  BusinessRule1 adds 4 business hours  (according to that BusinessCenter1) to the process running time so that we can clarify whether it should be today or the upcoming working day


    3. Process Definition runs the BusinessRule1 first, then  shifts the time of the due date to 16:00 user time and put an adjusted datetime value into the Due Date field




    Shifting the datetime to 16:00 is a primitive implementation has been configured with Logic Builder tool for Sugar via the following drawing

    You can try out the implementation on https://sg-example04.demo.sugarcrm.eu/ (user jim , password jim) by creating a new Task - automation will set a Due Date

    If that works, feel free to drop me a line and I will help to deploy the solution

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient