Welcome to my CRM Blog

Welcome to my new redesigned Dynamics CRM Blog.  My intention is to keep this more up to date than I previously had.

Hopefully this site will become a useful source of information regarding Microsoft Dynamics CRM

Virtual Entities for pulling in CRM data from other instances

A new feature in Dynamics is the concept of Virtual Entities.  This allows an entity to be created in Dynamics  where its data is not actually stored in Dynamics.  Its read only at the moment, but it allows you to pull in data from any ODATA data source, and display it in Dynamics as if it were part of the system, and that includes displaying data in quick view forms, grids, advanced find etc.

Now, one of the issues I have come across within my CRM experience is a requirement to pull in data from one CRM environment, into another.  This has generally involved data migration, or some sort of costly integrations.  So, with this new feature, I wondered if it would help solve this issue.

Well, it does and it doesn’t.  When trying to use Virtual Entities to pull in data from one CRM environment to another, I discovered a pretty big flaw, and that is authentication.  From one CRM environment, trying to get it to authenticate with another environment while querying the ODATA endpoint is tricky, or even impossible.  I didn’t spend too much time on trying to solve this, I just assumed it was a no go, so to be able to test Virtual Entities, I decided to throw all security concerns out the window, and come up with a simple test solution.

So, my plan was this :

  • Create my own ODATA web service
  • Connect to a CRM instance that contains the data using a specific user account
  • Pull out the CRM data, and present it in an unauthenticated ODATA endpoint.

Yes, yes, I realize that’s a bit scary (exposing CRM data without any kind of authentication), but this was just a test.  So, I now have an endpoint that proxies queries against the Contact entity.  So, the following URLS should return data from my CRM test environment, without requiring any username.

http://crmproxydata.azurewebsites.net/Contacts

http://crmproxydata.azurewebsites.net/Contacts?$filter=contains(Name,’Spencer’)

So, now that I have that very basic web service, I can now configure my new Dynamics 365 version 9.0 environment with an ODATA data source.

So, from the Settings, administration page, I can do the following :

And configure it like so:

And in my test solution, I create a new Entity and mark it as a Virtual Entity.

And configure the appropriate fields to match the information my web service is returning:

Now, if I do an Advanced Find in the CRM that does not contain any Contacts, but instead choose my new External Contacts, it shows the information from a completely different CRM environment.

And clicking on one of the records shows it in a normal “Read Only” form.

Bear in mind that it also supports all of the standard filtering criteria as well so you can filter the views, choose columns etc.

Now how great is that.  I think these Virtual Entities could be one of the best new features for Integrations I have seen in quite a while.  No more having to mess with Web Resources pulling in information from other systems.  No, instead, just treat the data in other systems as part of your main database, read only of course.

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.

DevOps for Dynamics 365

DevOps (a clipped compound of “development” and “operations”) is a software development and delivery process that emphasizes communication and collaboration between product management, software development, and operations professionals.

DevOps – The new buzzword.

Although I have never actually tried any of the following (but it is on my list of things to do), here are a collection of resources for applying the concept of Continuous Integration and Delivery for Microsoft Dynamics 365.

Continue reading “DevOps for Dynamics 365”

Dynamics Support – Tip of the day

I have to say, this tip of the day post is so on point, I found some of the comments laugh out loud funny and I could so relate to them.

 

Sounds very familiar. Use Edge as your Dynamics 365 browser, except when performing any form customizations, then use Firefox for that. Ah, yes, and Chrome for script debugging.

Yes, next release will fix that one, for sure! What do you mean, you have to use your Dynamics 365 in the meantime?

Secure the social security number field? Easy – apply javascript to hide it. Javascript is fast, typical user won’t be able to read the number before it disappears from the screen.

That’s right, fill in your Dynamics 365 with junk so that the users give up and go back to the Excel spreadsheets. You can still use Dynamics organization for prototyping and training.

 

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.

 

 

CODIAD – Self hosted cloud IDE for Microsoft Dynamics

When developing web resources for use in Microsoft Dynamics, I am a big fan of using Visual Studio with Visual Studio Team Services (VSTS), but for smaller organisations, or less experienced developers, sometimes this is overkill.  I know a lot of people who just make do with Notepad++, and why not, as it’s perfectly capable of editing code, syntax highlighting and formatting.

In my journey to discover and use as many self hosted web-based systems as I can (stay tuned for an upcoming post for more information), I wondered if there was anything that might help Dynamics developers.

That’s when I happened upon CODIAD ( http://codiad.com/ ) which is an online IDE for developing JS, HTML, CSS, XML and many more file formats.  It offers full syntax highlighting, project collections and an extensible plugin system.

Continue reading “CODIAD – Self hosted cloud IDE for Microsoft Dynamics”

Chat Bots – Part Two

Part two of my Chat Bot series expands a little on the original blog post.  Again, this post is more of a demonstration than a how-to as there are plenty of articles on the Web on how to develop Chat Bots using the Microsoft Framework.

To see it in action, click on the chat area at the bottom of the screen and start typing.  If you need help, just type help to see a couple of sample commands.  The new feature in the Bot is that you can now report an abandoned vehicle.  Why, I hear you ask.  Well, in my line of work, reporting a dead animal, reporting dog poo, and reporting an abandoned vehicle is the very key to my day-to-day work (and other things)!  I kid you not 🙂

Continue reading “Chat Bots – Part Two”