Update to CRM Utilities for Visual Studio

Just recently updated the CRM utilities extension with the following fixes :

  • Supports SVG files correctly. Although publishing files to an SVG Web Resource was working, if a file in Visual Studio had the SVG extension, when right clicking it, it would not offer the option to Link or Publish.
  • When extracting a solution from Dynamics, if the Web Resource naming convention does not have a file extension, then the Publish and Linking features would not work properly. Now, if it detects that the file has a corresponding “filename.data.xml” file (which it will if its been exported and unpacked from Dynamics), then it will offer the Publish and Linking options.
  • When trying to link or publish a TypeScript file, if an equivalent JavaScript file exists in either the same folder, or in an alternative JS folder, then its that file that will get linked or published. This means you can directly edit a TS file, save it and publish, without having to select the JS file.
  • An Entity Filter has been added to the Class Generation options allowing a list of entity logical names (separated by a semi-colon) to be entered. When creating a class file, any entities that are found in this list are not added to the file. This is very useful when you have a similar named custom entity that always clashes with a system entity. For example, if you have your own address entity, you can exclude the system address entity.

As usual, you can get the update from the Marketplace, or by downloading here :

Microsoft Dynamics Template for Visual Studio updated

I have recently updated my Visual Studio Template for holding Microsoft Dynamics Assets. Its available on the Marketplace by searching for Hallstudios, or you can download it using the button below.

  • I have added a new Project within the Solution Template for holding TypeScript files for use in the Entity Forms. Creating and editing a TypeScript file will automatically create a matching JavaScript file which can be uploaded to Dynamics.
  • The solution also includes Intellisense for the Xrm Client API within the TypeScript files.
  • The Solution Unpacker tool has been updated with the latest version so it now supports packing and unpacking Dynamics Solutions that contain Flow’s.

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

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.

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.

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.