Portals Support added to CRM Utilities for Visual Studio

Get it on the Marketplace

I have updated my extension to support publishing of files from Visual Studio to Microsoft Dynamics Portals.

The tool now supports publishing files to Web Templates and Web Files, allowing you to use Visual Studio to edit and track changes of your portal related files, and quickly update Dynamics with the appropriate Portal files.

Web Files and Web Templates are simply listed within the Web Resource linker dialog for you to select.  You can then publish the appropriate files within your Visual Studio solution to Dynamics.

If you have installed the extension from the Marketplace, then it should prompt you to update, but if not, you can get it from the below link.

CRM Utilities for Visual Studio

My utilities are now on the Visual Studio Marketplace

Just a quick update to say that all of my Visual Studio extensions are now on the Microsoft Visual Studio Marketplace, and are available to download and install direct from Visual Studio.

Visual Studio Marketplace

Simply go into the Tools menu and choose Extensions and Updates, select Online and search for me, James Hall.  My extensions are the top two in the list.

In theory, if you install them this way, you should get notified of when I update them.

Diagnostics and Information page, a reminder

As I keep forgetting that these pages exist, I am re-blogging the following information as its very useful :), and maybe I will eventually remember these URL’s.

Diagnostics
 
http://<ServerName>/<OrganisationName>/tools/diagnostics/diag.aspx
 
Debug Information (on premise only)
 
http://<ServerName>/<OrganisationName/home/home_debug.aspx

Here are some bookmarklets that you can drag to your bookmarks bar which should allow you to just click on them while on a CRM instance, and the appropriate pages should pop up.

CRM Utilities for Visual Studio – Update to menus, and class generation options

Today I have released an update to the CRM Utilities for Visual Studio 2017 extension.

New features:

Reorganised the menu structure so that the Generate Class options are now grouped together.

Generate Class options menu to allow a custom namespace and class name to be used when generating the class files to represent the Dynamics Entities.

Redesigned the Connection dialog to make it look better, and to include a hyperlink to the instruction pages on this blog.

 

Download
Please note this feature is only available in the Visual Studio 2017 version. This version may still install on VS2015, although I have not personally tested it.

CRM Utilities for Visual Studio – Generating Entity Classes

Most CRM Developers either use, or have at least heard of CrmSvcUtil for generating early bound classes for developing code and using the resulting classes to manipulate CRM data.  I personally do not like working with early bound entities as the resulting class files are huge, and I personally prefer working with the standard Entity Framework for creating and updating entities, and for Linq queries.

Often, I use some helper class libraries that I can use to represent the custom entity names and attributes, so that they can be referenced in code and provide a degree of separation from the actual Schema names and to make code easier to write, and support Intelli-sense.

Something like the code sample below:


public static class Contact
{
    public static const string EntityName = "contact";
    public static const string Name = "fullname";
}

This would then allow you to do the following:

public void createContact()
{
    Entity contact = new Entity(Contact.EntityName);
    contact[Contact.Name] = "Joe Blogs";
    service.Create(contact);
}

I was offered a suggestion by a fellow developer that wouldn’t it be good if my CRM Utilities for Visual Studio allowed you to generate this kind of Class file automatically.  Well, I thought it was a brilliant idea, and so thanks to the wonderful gentleman  of XRTSoft, here it is.

Its split into two options, one to generate classes for your Custom Entities, and one to do the Standard CRM entities.

The resulting file will look something like this:

Notice that for each Entity, it will add the Logical Name, Primary ID Attribute, and the Primary Name Attribute as standard, and then all of the attributes as well.  It will also add sub classes for any Option Sets to allow you to reference specific Option Set Values without having to look them up in CRM.

 

Download
Please note this feature is only available in the Visual Studio 2017 version. This version may still install on VS2015, although I have not personally tested it.

 

LinqPad Utilities for Microsoft Dynamics – New Release

Today I have just released the first official version of my LinqPad Utilities for Microsoft Dynamics plugin library.

I use this tool in my everyday life working with CRM and its gradually grown in to a fully fledged tool.

It allows you to configure a number of reusable CRM Connection Strings to connect to Microsoft Dynamics (all versions) and has a number of useful utilities for working with Dynamics.

Feel free to download and try it.

LinqPad Utilities for Microsoft Dynamics

To begin with, you will need LinqPad (which is free, but you can also purchase a license) from the following site.

https://www.linqpad.net/

 

Dynamics CRM Utilities for Visual Studio

I have decided to release a small utility that I developed and have been using for a long time when developing Web Resources for CRM within Visual Studio.

It allows you to publish Web Resources to CRM straight from within CRM, and if you attach it to a Keyboard Shortcut, means you can publish it with a press of a key as soon as you have finished editing it.

It allows you to edit JS, HTML, XML and images as part of a Visual Studio Solution.  It saves your connection string locally within a project, and remembers which files relate to which CRM Web Resources.  It also allows you to run FetchXML queries, and you can save your queries as part of your Project.

It can be downloaded from here, and full instructions on how to use it are also available.

CRM Utilities for Visual Studio

There are two versions, one for Visual Studio 2017 and one that is compatible with Visual Studio 2013 and 2015.

FormXML solution layering

When working with Managed Solutions, and layering them on top of each other, be mindful of one very important fact.

If you include an entity in a solution, that is also present in another solution, then the most recent solution to be installed in a system will take precedent over others when it comes to certain things such as entity forms.

For example, if you have solution A containing entity 1 and install it managed onto a server, and then later install solution B which also contains entity 1, then it’s solution B’s customisations that will be applied. If you later edit entity 1’s form within solution A and try and install it onto the server containing both solutions, the form customisations will not take.

You must always try and ensure, where possible, that each entity only exists in one solution. This would not apply if you were always going to be providing both solutions as a pair to be installed.

To safeguard, always attempt to create a new form in each solution so that customisations are carried out in each solutions specific form, and always try to avoid accidentally including entities in solutions where they don’t need to be as you can’t always roll them back due to dependancies.

Good news is that with CRM 2016, you can include only the bits you need in a solution making it easier to avoid these kind of layering issues.

Setting up Microsoft Dynamics CRM 2011 on Windows Server 2012 R2

I had a requirement to install Microsoft Dynamics 2011 onto a new server containing Microsoft Windows Server 2012 R2 for a Live Deployment, after developing using CRM on a Windows 2008 R2 server.  When the install wouldn’t work, it was then that I realised that 2011 is not officially support on Windows Server 2012.  That was an unpleasant surprise.  After doing some research, I found the required information to get it to work, and I have tried to describe the steps below for future reference.

 Step 1 – Windows Server 2012 R2

After installing the Server itself, and making sure its fully updated, you will want to make sure to add the following roles:

  • File and Storage Services
  • Web Server (IIS)
  • NET Framework 3.5 Features
  • NET Framework 4.5 Features
  • Windows Search Service
  • Windows Identify Framework

Step 2 – Retrieve the required files

As you will be unable to use your ISO or CD of Microsoft Dynamics to install, you will need to download the latest setup files from Microsoft.

Download the latest Microsoft Dynamics CRM 2011 Server setup file

Go to http://www.microsoft.com/en-us/download/details.aspx?id=27822 to download the latest Microsoft Dynamics CRM Server setup file. This also contains the appropriate SSRS Data Connector Setup File.

Download the latest Microsoft Dynamics CRM 2011 E-mail Router setup file

Go to http://www.microsoft.com/en-us/download/details.aspx?id=27818 to download the latest Microsoft Dynamics CRM E-mail Router setup file.

Download the Microsoft Dynamic CRM 2011 Self-Healing Setup (SHS)

Go to Microsoft Update Catalog http://catalog.update.microsoft.com/v7/site/Search.aspx?q=crm%20setup and then download the appropriate Setup Patches.  Instructions on what to do with these are further below.

Download the Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1

Go to http://www.microsoft.com/en-ie/download/details.aspx?id=36771 and then download the appropriate Setup file.

Download the Microsoft Online Services Sign-In Assistant

Go to http://www.microsoft.com/en-gb/download/details.aspx?id=28177 and then download the appropriate Setup file.

Download the Windows Live ID Sign-in Assistant 6.5

Go to http://www.microsoft.com/en-gb/download/details.aspx?id=15106 and then download the appropriate Setup file.

Download the Update Rollup 17 for Microsoft Dynamics CRM 2011

Go to http://www.microsoft.com/en-us/download/details.aspx?id=42672 to download Update Rollup 17 (or if there is a later version, then download that).

Step 3 – Configure your CRM Setup

  • Extract your main CRM setup files to a folder on your server’s hard disk, but don’t run it yet. For example, extract it to d:\setup
  • Run and extract the Self-Healing Setup file for the Server setup. Within the resulting folder you will see lots of similar files :
    svr2012scr1
  • Find the file for your language (English is 1033, so the file you need is en-server_kb2434455_amd64_1033_xxxxxxxxxxxxx.cab) and double click the file. Copy the file contained (extension msp) into the same folder that your CRM setup files are (so d:\setup). You could also remove all the extra characters from the end of the file if you wish.
  • Create a custom setup file called config.xml and place it in the same setup folder. The contents of the file are below :
    &lt;CRMSetup&gt;
    &lt;Server&gt;
    &lt;Patch update="true"&gt;d:\setup\Server_KB2434455_amd64_1033.msp&lt;/Patch&gt;
    &lt;/Server&gt;
    &lt;/CRMSetup&gt;
    

 

Step 4 – Run the setup

You can now run the setup from a command line by doing typing the following into a command prompt:

SetupServer.exe /config d:\setup\config.xml

This should then start the normal CRM installation routine. The checking for update step should show “Setup has finished downloading the update” to confirm that the setup has picked the SHS up correctly from the config file. After this, you can install CRM as normal.

Once it has fully installed, you must then run the appropriate latest update rollup to make sure your CRM instance is fully patched and compatible.

 Step 5 – Setup SSRS Data Connector for CRM 2011

I found that installing the SSRS was less problematic. I was installing to a separate Reporting Services Server, and I had setup an appropriate config file to incorporate the relevant SHS file into the setup procedure, but I couldn’t get the main setup to run.  It turned out that I was able to just install the SSRS Data Connector without any issue by default.

After its installed, make sure you run the Update Rollup 17.

 Step 6 – Setup the Email Router for Dynamics CRM 2011

 

The setup for the email router also did not require the SHS hack, but, there were other pre-requisites that I had to install before I could proceed. Once I found out what I had to install (the automatic download and install of the setup would not work) everything went smoothly.  Just install the following three components onto the server, and the Router setup should then work without any issue.

  • First, Install the Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1.
  • Then install the Microsoft Online Services Sign-In Assistant
  • And finally, install the Windows Live ID Sign-in Assistant 6.5

With these three components installed, the router installation was a breeze.