Update a Record using Xrm.WebApi

Let’s look at how we can use the Xrm.WebApi to update a record. Let’s use the Account entity, where we have a field called My New Field (new_mynewfield): Here’s the update script: [sourcecode language=”CSharp”] var data = { "new_mynewfield": "TEST" } var Id = Xrm.Page.data.entity.getId().replace("{", "").replace("}", ""); Xrm.WebApi.updateRecord("account", Id, data).then( function success(result) { console.log("Success"); }, function (error) { console.log(error.message); } ); [/sourcecode] We can run this in the browser console … Continue reading Update a Record using Xrm.WebApi

Get the Id of a Record on a Page in Dynamics 365 Power Apps

Let’s look at how to get the Id of a record in Dynamics 365 Power Apps using JavaScript. We can see below our Account record with the Id in the URL: To get the Id of the record in JavaScript, let’s run the code below, which Xrm.Page.data.entity.getId(); or by passing the formContext: formContext.data.entity.getId(); And to remove the curly braces: Xrm.Page.data.entity.getId().replace(“{“, “”).replace(“}”, “”); Or formContext.data.entity.getId().replace(“{“, “”).replace(“}”, “”);  

The App You’re Trying to Install Isn’t a Microsoft-Verified App

You may get the error message “The App You’re Trying to Install Isn’t a Microsoft-Verified App” when running an application that wasn’t downloaded from the Microsoft App Store. To resolve this, click on Change my app recommendation settings, or in Windows open Settings. Select the drop-down list for Allow apps from the Store only: We have several options: Set this to Turn off app recommendations: Relaunch your app. The message … Continue reading The App You’re Trying to Install Isn’t a Microsoft-Verified App

Increasing Email Attachment Size in Dynamics 365

In Dynamics 365, the maximum size of an email attachment defaults to 5120kB, or 5MB. Let’s look at how we can increase this. First, let’s create an email message and try to add a large attachment. Go to Activties and create a new Email: Add a new attachment: Click Choose File: Let’s add a PDF file: When we try to attach it, we get the message that “The attachment is … Continue reading Increasing Email Attachment Size in Dynamics 365

Coding Multiple Plugins in One Assembly in Dynamics 365

In this post we will look at how to code 2 plugins in one assembly. This might be useful if you want to keep related pieces of code under the same code base. Let’s create a new VS project: Rename the class to Plugins: Add Microsoft.CrmSdk.CoreAssemblies through NuGet. Add the code. We will add 2 functions, Plugin1 and Plugin2: The code will write a Plugin Trace Log entry. [sourcecode language=”CSharp”] … Continue reading Coding Multiple Plugins in One Assembly in Dynamics 365

Installing Azure CLI on Windows

Azure CLI is a command line interface (CLI) for managing resources in Azure. It can be accessed from within Azure in a browser, or by installing an app that runs in Windows, Linux and macOS. To install it on Windows, go to: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest and click Download: Open the downloaded file: Click Accept and Install: Click Finish: Now, open PowerShell and type az login: A browser will open, and you will see … Continue reading Installing Azure CLI on Windows

How to Delete USD Cache to Recover from USD Errors

In Unified Service Desk, users may encounter errors when using USD, such as pages not loading, custom JavaScript not running etc. These errors may be a result of USD caching. To delete the USD cache, first browse out to your appdata folder in Windows Explorer. You can access appdata by typing %appdata% in the Windows Explorer navigation bar, which will take you to the user’s AppData\Roaming folder. Next, delete the following folders, which … Continue reading How to Delete USD Cache to Recover from USD Errors

XrmToolBox Error When Loading

When opening the XrmToolBox, you may come across errors such as: System.TypeLoadException: Could not load type XrmToolBox.Extensibility.Interaces.INoConnectionRequired System.IO.FileNotFoundException: Could not load file or assembly ‘WeifenLuo.WinFormsUI.Docking, Version=3.0.4.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481’ or one of its dependencies. The system cannot find the file specified. The problem here is to do with one of the plugins that is in your XrmToolBox environment. To resolve this, go to: %appdata%\MscrmTools\XrmToolBox\Plugins\ Copy the files from the Plugins folder to … Continue reading XrmToolBox Error When Loading

Creating a WCF REST Service with Entity Framework

In this post, we will go through how to use WCF to create a REST service, also using the Entity Framework to connect to a database. We have a SQL database that holds customer information. We would like to expose this as through a REST service. In the database, we have a table called Customers that we will build our service for: Open Visual Studio and create a new WCF Service … Continue reading Creating a WCF REST Service with Entity Framework