Introduction
Introduction of Microsoft Flow for Dynamics 365 CRM has extended the functionality of Dynamics 365 CRM thereby allowing it an easy way to interact with other systems or include features which required much more custom development.
It is also considered as an advanced version of Workflow where we can achieve tasks which were difficult to achieve using Workflow. In this blog, we are going to discuss one of the flow component – Delay Until and how it works with different behaviour of CRM data type ‘Date and Time’.
Here we are going to consider a scenario to check the working. There will be a Next Revised Date on Quote and we need to create task automatically that will inform the user that they need to create New Quote when Next Revised date is elapsed. Given below is the design of the Microsoft Flow:
We have created three date fields for each date behaviour and used them one by one for Delay Until as shown in the above screen shot to check their behaviour.
- Next Revised Date 1: With Behaviour “User Local”
- Next Revised Date 2: With Behaviour “Time-Zone Independent”
- Next Revised Date 3: With Behaviour “Date Only”
Now let’s discuss them in detail.
1. Next Revised Date 1: User Local
To check how it works we have created two users with one in IST time zone and another in EST time zone.
To make Microsoft Flow available to another user you need to add second user as Owner of the Flow as shown below in the below screenshot:
To navigate to this window you need to Edit Flow, then Edit Flow Connections as shown below:
Still you won’t be able to execute Flow and you will face error for permission as shown below:
Here, you will need to add connection for Login user as shown below. Only then, you will be able to execute the Flow for second user.
Here since Microsoft Flow connection is provided for each user, Next Date will be considered as per their respective Time Zone instead of the user which configured the Flow. We checked and found that the Flow were in waiting stage as per user’s respective Time zone as shown below:
2. Next Revised Date 2: Time-Zone Independent
As this field is to store UTC date and time, Flow as well uses UTC date to execute the task. So in this case when Flow waits for Date and time to elapse it is actually based on UTC Time Zone.
As shown in below example, we have set local time for Next Revised Date 2.
Here, local time already elapsed on 7:15 AM but Flow is still in waiting stage since UTC time is still 3.00 AM. It completes execution at UTC 3.00 AM.
3. Next Revised Date 3: Date Only
Field with this behaviour is not available for selection as shown in below screen shot where earlier fields ‘Next Revised Date 1’ and ‘Next Revised Date 2’ are available and ‘Next Revised Date 3’ is not.
Note: In workflow if we are to update the field, for example, we have similar workflow which have waiting Job for date of next year and we change the record date with today’s or yesterday’s date then in that case all waiting jobs will be executed. But in case of Microsoft Flow, it will store the details and wait for the date to arrive next year instead of today’s date.
Conclusion
As illustrated above, in this way Microsoft Flow component ‘Delay Until’ functions with different behaviour of Dynamics 365 CRM data type ‘Date and Time’.