Convert FetchXML to QueryExpression in Dynamics 365 with Web API Example

In this post, we will go through an example of converting FetchXML to a QueryExpression. We will do this by debugging a Web API call in a plugin. To debug Web API calls using the Plugin Registration Tool, do the following. First, create a Web API query, e.g. select the name and revenue fields in the accounts entity filtered by name. E.g. https://yourorg.api.crm.dynamics.com/api/data/v9.1/accounts?$select=name,revenue&$filter=name eq ‘3M’ In Visual Studio, create a new … Continue reading Convert FetchXML to QueryExpression in Dynamics 365 with Web API Example

Calling the RetrieveEntity WebAPI Function with Enum Types

In Dynamics 365, there are several functions that we can call from the Web API. You can see a list of these functions here. When calling these functions, we can use Xrm.WebApi.execute and specify an action as the operationType: In some cases, this doesn’t appear to work as expected, and you may need to revert to sending through the request using XMLHttpRequest. Let’s look at the example of using the … Continue reading Calling the RetrieveEntity WebAPI Function with Enum Types

Using Microsoft Flow to Create Recurring Tasks in Dynamics 365

Microsoft Flow can be used to create recurring tasks in Dynamics 365. Let’s go through an example. Let’s say we want to send create a task that reminds a salesperson to call their customers every morning. Sign in to https://flow.microsoft.com. Select My Flows, then New: Pick Scheduled – From Blank: Set a date, time and frequency. The flow can run every Month, Week, Day, Hour, Minute and Second: Click Create. … Continue reading Using Microsoft Flow to Create Recurring Tasks in Dynamics 365

Import Excel Data into a Model Driven PowerApp using Data Integration Project

In this post, we will import data from an Excel spreadsheet into a model-driven PowerApp, creating a Data Integration Project that uses Power Query. First, let’s look at a spreadsheet we have. It contains 2 accounts, with the account name and revenue: This spreadsheet is sitting in a SharePoint library. Let’s go to PowerApps.com and pull up our model-driven app. Select Entities: Clicking on Accounts, we can see the data … Continue reading Import Excel Data into a Model Driven PowerApp using Data Integration Project

Using the Power Query (M) Builder for XrmToolBox to Generate M Code for Dynamics 365

In this post, we will look at using the Power Query (M) Builder in XrmToolBox, developed by Mohamed Rashid and Ulrik “CRM Chart Guy” Carlsson. This tool is a great way to quickly help build Dynamics 365 reports in Power BI. It generates M queries with and without FetchXML as well as handles fields such as option sets. To install it, open the XRMToolBox and find the Power Query (M) Builder app. … Continue reading Using the Power Query (M) Builder for XrmToolBox to Generate M Code for Dynamics 365

How to Display an Alert in Power Apps using JavaScript

When using JavaScript, we can display alerts in model-driven Power Apps. To do this, we can use openAlertDialog. The syntax for this method looks like below: Xrm.Navigation.openAlertDialog(alertStrings,alertOptions).then(closeCallback,errorCallback); As a simple example, we can use: var alertStrings = { confirmButtonLabel: “Got it”, text: “Something happened.”, title: “Alert Title” }; var alertOptions = { height: 500, width: 500 }; Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then( function success(result) { console.log(“Alert dialog closed”); }, function (error) { console.log(error.message); } … Continue reading How to Display an Alert in Power Apps using JavaScript

Posting Customizations Causing Page Refresh in Dynamics 365

In Dynamics 365, when a developer publishes a customization, users may see a page refresh. This piece of code appears to be specific to using legacy forms. We will demo this with the Account form. Go to the account, and press F12 to open the developer tools: Search for _metadatacacheversion: Open the JsProvider.ashx version (other files may run during other circumstances). Click the curly braces to Pretty Print the file … Continue reading Posting Customizations Causing Page Refresh in Dynamics 365

Creating a Dynamics 365 Dashboard showing Opportunity Data

In Dynamics 365, it is easy to create dashboards that users have access to that display critical information. In this post, we will look at how to build an Opportunity dashboard. Select Dynamics 365 Dashboard: We will choose the 3-column regular dashboard layout and click Create: We see below: Give the dashboard a name: In each pane, we can add: Chart List Relationship Assistant IFrame Web Resource Power BI tile … Continue reading Creating a Dynamics 365 Dashboard showing Opportunity Data