Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

daily check resulting

  • 1.  daily check resulting

    Posted Jan 15, 2020 03:52 AM
    Hi all, can anyone suggest a good solution to the following;

    We need a daily check of a date field on a custom entity to see if it is within 6 months of today, if it is and the business process flow(BPF) is at stage 4 then update BPF to stage 5.​

    Thanks in advance.

    ------------------------------
    Ben Fisher
    Associate Technician
    Ordnance Survey
    Southampton
    ------------------------------
    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: daily check resulting

    GOLD CONTRIBUTOR
    Posted Jan 15, 2020 08:30 PM
    Ben
    You might want to consider using Power Automate because of the recurrence aspect of your scenario and use the Recurrence trigger to schedule it. Elaiza Benitez has a really good post here on how to move stages on a BPF​ using Power Automate. Since your condition is checking whether the Active Stage is within 6 months, you will have to calculate  the difference between "Active Stage Started On" date and utcNow(). The way I've calculated difference in days in flow since there's no Datediff function is by using the Compose Action and the ticks() function as shown below. The last compose action contains difference between today and Active Stage Start date, so you can use that as the as your condition, instead of the Switch statement she uses in her blog post.
    The Expressions in each of the Compose actions are as follows:
    ticks(body('Get_record')?['activestagestartedon'])
    ticks(utcNow())
    div(sub(outputs('CurrentTIme'),outputs('ActiveStageDate')),864000000000)




    ------------------------------
    Edrei Mpanduki
    Technical Analyst
    Scottsdale AZ
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role