Posts

Dynamics 365 v9 Virtual Entity using OOB OData v4 Provider - PART 3

Image
In the previous post  Dynamics 365 v9 Virtual Entity using OOB OData v4 Provider - PART 2 , we created the virtual entity Jobs in Dynamics 365. In this post, we are going to run a few testing scenarios with this virtual entity. Viewing, sorting & searching When I created the virtual entity, I ticked the Sales area to display the entity. So navigate to Sales -> Jobs. The home grid will display. Click the column Scheduled Start to sort by ascending. Page 1: Page 2: Sorting works fine for all other columns. Type in Job 14 in grid search text box, and job with Job Name 14 is shown. Query sent to API: $filter=startswith( JobName ,'Job%2028')&$top=25&$select=JobName,ScheduledStart,CustomerId,JobId&$count=true Type in 31/12/2018 in grid search text box, and job with Scheduled Start on that day is shown. Query sent to API: /Jobs?$filter= ScheduledStart ge 2019-01-09T00:00:00Z and ScheduledStart le 2019-01-10T00:00:00Z or star...

Dynamics 365 v9 Virtual Entity using OOB OData v4 Provider - PART 2

Image
In my previous blog  Dynamics 365 v9 Virtual Entity using OOB OData v4 Provider - PART 1 , we created a Web API using OData v4 format. In this blog post, we are going to create the virtual entity in Dynamics 365. Login to Dynamics 365 with system admin role. Go to Settings -> Administration -> Virtual Entity Data Sources. Click + NEW button to create a new data source. As shown above, there are a few things you need to know. URL: the URL to the Web API we deployed in previous post. Pagination Mode: I always select Client-side Paging. The difference between Client-side Paging is described below. Return Inline Count: I always set it to True. The client-side paging won't work if you don't set this to True. With Client-side Paging, the OBB OData v4 Data Provider uses $Skip and $Top parameters in the URL to get the correct records in each of the pages. For example: /Jobs?$top=25&$select=JobName,ScheduledStart,CustomerId,JobId&$count=true Howeve...

Dynamics 365 v9 Virtual Entity using OOB OData v4 Provider - PART 1

Image
Virtual entity is great new way of letting Dynamics 365 users to consume external data in read-only mode. In version 9.0, developers can develop custom data source providers to interact with external data sources rather than using the OOB OData v4 Data Provider. The purpose of this post is to provide some guideline for setting up a virtual entity using the OOB OData v4 Data Provider by connecting it to a custom developed Web Api and see what we can do with the virtual entity in Dynamics 365. So, custom data source provider would be another post for another day. At the time of writing this post, I am using Dynamics 365 version 1710 (9.0.2.2074) online for development and testing. There scenario  We have a list a customers (Accounts) in Dynamics 365, and we record customers' job data in another system. Users would like to see customers' job data in Dynamics 365 rather than open another application to find related jobs. Job Data Model Just for demonstration's sake,...

TLS 1.2 and PowerShell

To view security protocol that your PowerShell currently uses, use the below command: [Net.ServicePointManager]::SecurityProtocol By default, PowerShell doesn't use TLS 1.2. This causes some problems if you use PowerShell a lot to work with Dynamics 365 and other popular SaaS applications, due to more and more applications are now forcing TLS 1.2 for incoming connections. Taking Dynamics 365 as an example, you may now keep getting the error message "More then one org was returned, retry with an exact org name" when using Get-CrmConnection PowerShell command. This is due to Dynamics 365 now only accepts TLS 1.2 connections, and your PowerShell is not forcing that. To work around it, put the below PowerShell command before making the connection: [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; Just like doing the same in C# code to force the connection to use TLS 1.2, but this is in PowerShell. The Get-CrmConnection ...

Dynamics 365 Organization Insight is making the My Apps link disappear under Settings

Image
I need to update some custom Dynamics 365 Apps' permissions today for a customer, and then I headed to the usual place under Settings -> Application -> My Apps. However, surprised me that the whole Application group disappears, I can't find it anywhere. After a bit of testing in a trial environment, I figured out that it is the Organization Insight solution we installed from AppSource that removes the link from sitemap. Below is the image of the links displayed under Settings in a new trial Dynamics 365 v9.0 instance before I install Organization Insight. And here is what it looks like after installing Organization Insight. As you can see in the above screenshots, the Process Center and Application groups disappeared, and also the Training Area also gone. To fix this, create an unmanaged solution and add Site Map client extension to the unmanaged solution, like below. Then export the unmanaged solution to your local folder. Unzip the file, an...

Global custom action returns 204 No Content rather than the defined output parameters

I have been working on a lot of custom actions lately in Dynamics 365, version 8.0 to 9.0. I have problem updating the custom actions again and again. The custom action suppose to return some output parameters, but it kept returning 204 No Content status, and there is no content in the response. This happened as soon as I made changes to the custom action, either the parameters or the steps, save and activate the custom action. It seems like there is a bug with the UI of the workflow designer for global actions. The generated workflow XAML of the action contains a Target entity and is set to NULL and this is invalid, it shouldn't even be in the XAML file at all. The trick to work around this and get the custom action working again is simply doing the following: - Deactivate the custom action; - Change the unique name of the custom action, I simply just put random number at the end of the current name; - Press the Save button (don't need to activate); - Change the uni...

TLS 1.2 in Azure Function connecting to Dynamics 365

July 2017 update for Dynamics 365 (online)  requires connections to customer engagement applications to utilize TLS 1.2 (or better) security. If you are connecting to  July 2017 update for Dynamics 365 (online) from an Azure Function using Xrm Tooling dlls, you may experience error being returned, "Unable  to login to dynamics crm ...". This is because the .NET Framework version of Azure Function (C#) is 4.6.1, and by default it doesn't use TLS 1.2. To fix this, just add ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; before you initialize the CrmServiceClient object. using System; using System.Configuration; using System.Net; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Host; using Microsoft.ServiceBus.Messaging; using Microsoft.Xrm.Tooling.Connector; namespace GymSports.Azure.Integration {     public static class Contacts     {         [FunctionName...