MS Flow is an alternative for Dialog

We all know that dialogs should be replaced with either BPF or Canvas App as dialogs were deprecated in Dynamics 365 CE, but what if we want a simple dialog which will accept some custom parameters and use those values to process the business logic? The best alternative for this scenario is MS Flows. We can create a Flow and call explicitly from “Flow” button on the CRM record. For this, we need to create a Flow with the trigger “Common Data Service –> When the record is selected”. Take an example to convert a lead to opportunity based on some parameters. The below is the Flow that I developed.

After the Flow creation, you can see this Flow from the Lead entity records like below.

The Flow will open the dialog like below with set of questions that we defined above once you click on “Qualify Lead” button.

Click on “Run Flow” button to execute the Flow

Your flow executed successfully and created an opportunity record.

With this, we can create simple dialogs very easily with out any extra efforts. Hope this will be useful for other developers.

How to use special date operators (last-month for ex) in OData and MS Flow

Today we got a requirement to fetch all the records that are created in the last month by using MS Flow. We can do this by using “Dynamics 365 List records” action and we have to provide OData filter query for this action. I tried to use the same “last-month” operator that we use in the fetch xml. But this will not work for OData query. We need to use “LastMonth” function for this as defined in this link. The below are the examples to use these date functions.

In OData Query

?$filter=Microsoft.Dynamics.CRM.LastMonth(PropertyName=@p1)&@p1=’createdon’

In MS Flow

Hope it is useful….