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.

Dynamics 365 SDK tools – Powershell Downloader from Microsoft.

Since Microsoft have now removed the standalone SDK download, instead offering it via NuGet packages, they have also released a handy PowerShell script that allows you to keep them updated on your machine. Very useful.

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.

 

Preview CRM/D365 Tablet Experience

Microsoft Dynamics includes a nice Tablet experience UI right out of the box, and its possible to preview this using a desktop PC web browser.

To make it easy to do, I have developed a nice little Bookmarklet which you can drag to your bookmark bar within your browser.  Now, if you browse to your CRM or D365 instance and are logged in, clicking it in your bookmark bar will launch a new window showing you the tablet interface.

So go ahead, just drag the below button to your browsers bookmark bar, and away you go.

 

 

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.

Creating Web Resources using Dynamics CRM Themes

Very often there is a requirement to create Web Resources to be used in Dynamics CRM that provide some form of user interface.  Sometimes it may just be to display some data that you otherwise could not display using QuickView Forms, sometimes its to provide some buttons to trigger integrations that need to be on a Dashboard.

I have seen instances where the standard Windows Grey buttons are used, and also seen Web Resources that are graphically styled like they have come straight out of the Web 2.0 UI style guide.  These often look inconsistent with how Dynamics CRM looks, and can either be distracting, or look like a dog’s dinner.

Often, most good CRM developers will create a standard style sheet, upload it to their solution, and reference it from any Web Resource that needs it.  I would say that this is still a good thing to do, but I wanted to enhance it a bit so that a UI provided by a Web Resource would blend in with CRM without any additional work.  This has especially become crucial when a lot of companies will brand their Sandbox environments different to their Production environments (sometimes using garish colour schemes) to instantly alert their users as to which environment they are on.  CRM provides Custom Themes for this task, and although they are still quite limited, I wanted to be able to tap in to this feature.

Changing the colour scheme of CRM

So, I had the idea of creating a mechanism that would automatically retrieve the Theme and style up any User Interface elements using those settings.

Continue reading “Creating Web Resources using Dynamics CRM Themes”