Creating and Debugging a Plugin in Dynamics CRM 2016

The Dynamics CRM 2016 SDK contains a plugin sample. The code is located here: SDK\SampleCode\CS\Plug-ins\AccountNumberPlugin.cs I’m going to go through step by step how to create this plugin and upload it to Dynamics CRM, then how to debug the plugin. In the example I will connect to a Dynamics CRM 2016 Online instance. Firstly, open and build the sample plugin solution in Visual Studio: Next, open the plugin registration tool. This is located … Continue reading Creating and Debugging a Plugin in Dynamics CRM 2016

Trust Relationship Primary Domain Error

You may come across this error when a server or workstation gets out of sync with the domain controller: “The trust relationship between this workstation and the primary domain failed”. One way to resolve this is to rejoin the machine with the domain. However this can cause other issues. An easier way toresolve this, is to first log into the machine as a local administrator and then run Windows PowerShell … Continue reading Trust Relationship Primary Domain Error

Node Server Upgrade on Windows

Here we will go throgh the steps to upgrade your Node server. First, open PowerShell as Administrator. We will check the version of the server currently installed, with the command: node -v Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force Then run: npm install -g npm-windows-upgrade Next, run: npm-windows-upgrade Select a version: You will see: And once complete:  

Install Node on Windows

To install Node on Windows, first go to the Node website and select the version to download. We will install Windows 64 bit: https://nodejs.org/en/download/current/ This downloads the MSI file. Open the file: Click Next: Click Next: Click Next: Select all the required components, including NPM Package Manager. Click Next: Click Next: Click Finish: With NPM installed, you have access to thousands of packages. You can read more about NPM at … Continue reading Install Node on Windows

Function Overloading in JavaScript

Function Overloading is the ability to define two or more functions with the same name that have a different signature, i.e. a number and/or different types of parameters/arguments. For example: function DoSomething(a) function DoSomething(a,b) function DoSomething(a,b,c) In JavaScript, there is no function overloading. There is however behavior regarding sending different parameters, and there is a pattern we can use to handle function overloading. First, consider the case above. If we … Continue reading Function Overloading in JavaScript

WPF – Grid Splitter

Let’s say we have the following WPF form that has 3 rows and 2 columns: If we wanted to give the user the ability to resize the columns, we can use a GridSplitter. Under WPF Controls, you will see GridSplitter: First, we will add an additional colum. This will hold the splitter: Next, we will move our textboxes to the right column, so it frees the middle column for resizing: … Continue reading WPF – Grid Splitter

WPF – Column and Row Definitions

In a WPF grid, we can define columns and rows. To do this, create a new WPF app in Visual Studio: You will see below: Select Layout in Properties. You will see Column Definitions and Row Definitions: Select Column Definitions. Click Add: Here you can add a column definition, which is defining a column, just as you would in a table for example: Add a second column definition: You will … Continue reading WPF – Column and Row Definitions

WPF – Disable Visual Studio UI Debugging

When you create WPF apps in Visual Studio, you will see an extra toolbar on your WPF forms: This is the UI Debugging Tools for XAML in Visual Studio. Options include: Go to Live Visual Tree Enable Selection Display Layout Adorners Track Focused Element To disable this, in Visual Studio select Tools->Options: Debugging->General->Enable UI Debugging Tools for XAML: Rerun and you will now not see the tools:  

WCF Fault Exception

In this example, we will show how to use the FaultException when catching errors in a WCF service. First, create a new WCF service: Our service will be a calculator, that will perform a divide operation. We will rename the files created so we have: Calculator.svc ICalculator.cs In ICalculator, change the code to be below. This is our service contract and operation contract: using System; using System.Collections.Generic; using System.Linq; using … Continue reading WCF Fault Exception

WCF Specify Names of Contracts

Consider a WCF service that returns some text that you entered. The service has a contract called IService1 and an operation called GetData. When we run the service in our test client, we see: The code for this is: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; namespace Carl.TestWCF { [ServiceContract] public interface IService1 { [OperationContract] string GetData(int value); } } Let’s say we … Continue reading WCF Specify Names of Contracts