Posts in Category: dynamics 365

Getting Started with the Dynamics Web API

The Dynamics Web API is the new “preferred” method for interacting with Dynamics entities from web-based applications.  If you are writing plugins and coded workflow activities, you would still use the pre-existing Dynamics SDK.

Getting familiar with the Web API is a bit of a leap of knowledge as you will dabble in Azure Authentication, JSON and Async implementations (if you’re not familiar with it).

Even though the API has been around since 2016, it’s disheartening to see there not being a singular location for Dynamics developers to bridge their current knowledge of the Dynamics SDK to the Web API.

Lots of trial and error still exists and this isn’t helped by the naming of the API either.

Also note, if you are hoping to get away with the now “vintage” Dynamics SDK, in

Read More


Accessing the Dynamics SDK in v9

If you are moving your work from an old Dynamics instance to v9, there are a few SDK to know about before you get started.

First – there is no SDK to download anymore.

Well, there is, but you do it through Nuget (and it’s great).

To install the core SDK framework – use the following Nuget command.

Install-Package Microsoft.CrmSdk.CoreAssemblies -Version 9.0.0.7

This will install all the core assemblies you need (i.e., not things like workflow assemblies).

To get the workflows you would need to execute the following Nuget command;

Install-Package Microsoft.CrmSdk.Workflow -Version 9.0.0.7

Different from the last few versions of Dynamics where you could get away with re-using SDK tools between different versions, with v9, you now need to download the updated set of tools via Powershell and use them from there.

Before downloading the

Read More


Dynamics Workflow Registration Mismatch

Recently I was deploying an update to a workflow when I received the following message.

workflowfail

Upon further investigation, the cause of the problem were the dll references I was using for deploying this particular code to this particular environment.

I had updated my Dynamics SDK to use the latest set of dlls (8.2.0.566) while the environment I had already deployed to was on (7.1.0001.3108).  A few updated file references later and I was back in business – coding, registering, deploying and testing my code.

Read More


Don’t Sweat the Customizations

Dynamics365 (and it’s previous incarnations) is designed and built to be customized and integrated into your pre-existing Line of Business applications and/or seamlessly integrate into your new ones.

That’s the goal of the platform (in my humble opinion).

To this extent, the only times you should be afraid of performing customizations on the core or extended system are;

  • You don’t understand the requirements and are changing things willy, nilly all over the place.
  • You have gone beyond writing your own code and are now changing underlying code which may or may not be supported in future upgrades.
  • You are recreating functionality that already exists in the system in your own variant.
  • You are taking something called an account and making it look like a “cat” but then having to create another thing called an “account” because

    Read More


Adding Items to a Dynamics Queue

Continuing off my post of adding items to a queue programmatically, I wanted to add items to this queue (why else would I be using a queue?).

The code here is relatively simple and boring as I queried for a contact named Andrew, found him and added a new queueitem to the queue.

QueryExpression queryContact = new QueryExpression();
queryContact.EntityName = "contact";
queryContact.ColumnSet = new ColumnSet(true);
queryContact.Criteria.AddCondition("firstname", ConditionOperator.Equal, "Andrew");

EntityCollection entityContacts = _CrmService.RetrieveMultiple(queryContact);
EntityReference contactRef = new EntityReference("contact", entityContacts[0].Id);

Entity q = new Entity("queueitem");
q["queueid"] = new EntityReference("queue", _QueueId);
q["objectid"] = contactRef;
_CrmService.Create(q);

The results were anything but.

The first time I executed this code it worked fine, created a new queueitem record and associated to my man Andrew.

The second time I executed this code, it exploded with the following message (which seems odd for a queue to do).

Read More