Category Archives: Dynamics CRM

Tips and techniques I've collected while working with Microsoft Dynamics CRM 3.0

v4.0 of ShapShot!, the ultimate Dynamics CRM documentation tool is coming soon

I’ll be shipping the next version of my Dynamics CRM documentation tool, SnapShot!, very soon.

One of the new reports I’m really excited about allows you to visualize entity privileges across security roles.  Here is an example:


The are additional new reports and other enhancements as well so keep an eye out for the next announcement.

For more information about SnapShot!, visit the product page.

Notes from the Field: Working with Dynamics CRM Dialogs

Here are a few notes I’ve collected while working with a Dynamics CRM project involving dialog processes:

Required Fields

There is not a feature to allow a dialog field to be required, Dynamics CRM Tip of the Day, Tip #391: Mandatory fields in dialogs discusses a possible work around.

Float Data Field

One of the possible data entry types is a floating point number, which has five decimal places to the right of the period. Unfortunately, there is no way to change the number of decimal places, so we’re stuck with showing the users all five.

Option Set Field

OptionSets have a few things going for them that make them fairly cool to use, but also have some restrictions.

  • An OptionSet can be displayed as a normal drop-down or a series of radio buttons.
  • There seems to be no way to extract the contents of an existing OptionSet field for inclusion in a dialog so you must manually replicate the contents of the existing OptionSet field. This makes for a secondary maintenance point should you need to change or alter the values of an OptionSet.
  • There is no default value for an OptionSet. Instead, just put the default value at the top of the list.
  • The final thing that is rather cool about OptionSets is the ability to define, and later use, a CRM Data Query to extract a list using a FetchXml query.

Two Option Field

There is no Two Option field, so you will need to create your own using a OptionSet, formatted as either a drop-down or two radio buttons.

Lookup Field

Configuring a lookup field can be a little bit different than you expect. Read Leon Tribe’s article: Dialog Lookup Values For Common Entities for more information and some pointers.

Field Tips

Each field has a Tip property associated with it which will allow you to display additional information or instructions to the user. I can see this coming in handy.

Page Names

Even though we have the ability to break our dialog into pages, and give each page a name, that name doesn’t seem to display anywhere. But it would be nice if it did.



I have honestly avoided dialogs because they seemed so rudimentary and also do not seem to have been shown much love since they were released in Dynamics CRM 2011, but they do have their uses and if the CRM team could carve out a little time to correct some of the shortcomings, then they would prove quite useful.  Until then there are always third-parties like TK Dialogs.

How to capture moble login errors with Azure ADAL

If you are creating a mobile application that uses the Azure Active Directory Access Library (ADAL) component, you will need to learn how and when errors are returned from the component.

Here are a few to get you started:

Error Messages

#1: User presses the cancel button on the first login page

If the user presses the Cancel button on this page:


You will receive the following error message:

User canceled authentication


#2: User presses the cancel button on the permissions page

If the user presses the Cancel button on this page:


You will receive an error message that starts with:

aadsts65004: the resource owner or authorization server denied the request.


#3: User supplies incorrect URL

If you are creating an application that accesses Dynamics CRM Online, you must pass in the URL for the organization you wish to connect to. If the URL supplied to the ADAL service is incorrect, you will receive the following error message:

Error: nameresolutionfailure


#4: ADAL component cannot display the login page

The way the ADAL component works is by displaying a webview control in which is loads the web-based login pages to request user credentials using OAuth. If the ADAL component has an issue displaying that webview, you will receive the following error:

authentication_ui_failed: the browser based authentication dialog failed to complete


Handling Errors

Some of these errors need to be reported back to the user an an error and some do not.

#1 and #2 simply mean the user has canceled the operation and you can probably safely ignore the error and cancel the login operation.  But keep in mind that #2 could also generate a real error but I am not exactly sure of the circumstances where that would occur.

#3 is an error that needs to be displayed to the user, but I would change the actual message to something that makes more sense to the user.

In my case, I was asking for the organization name and the Dynamics CRM Data Center (crm, crm2, crm4, etc.) and if the user entered or selected the wrong information, then I wanted to tell them it was incorrect instead of showing the nameresolutionfailure message.

#4 in all likelihood means that your application is not passing the proper window handle to the control (RootViewController in the case of iOS) which is a condition you need to correct or your app will never work with ADAL correctly.

Join Next Month’s Hand’s-On Workshop: Plugin Development for Dynamics CRM

Developing Dynamics CRM plug-ins is hard, right? Well, not really; there just happens to be a lot to know and understand about both the development process and the actual implementation process.

Our teaching methodology involves you writing a lot of plug-ins, after all, doing is the best way to learn, right? We will have between fifteen and twenty exercises, some of which will be conducted in class, some of which will be assigned as homework. Again, lots and lots of hands–on lab work to help you reinforce the concepts of plug–in development.

The Agenda

Here are the high–level topics that we’ll cover:

  • Plugin architecture and design
  • Setting up your development environment
  • Developing a basic plug–in
  • Deploying plug-ins
  • Debugging plug-ins
  • Developing custom workflow activities
  • Maintenance and troubleshooting
  • Additional miscellaneous topics

The Specifics

When: Thursday, November 12th and Friday, November 13th. 8:00am–4:00pm Central time

Where: “In the cloud.” This is virtual training with each student receiving their own development server for the duration of the class. We’ll be conducting the class using GoToMeeting.

How Much: We are offering two types of tickets:

  • Standard Seat: $895 per person
  • Premium Seat: $1,495 per person.

The Premium Seat includes 4 hours of post-workshop consulting services to help you get through some of the challenges that you may face with your first plugin development project.

*** A 10% discount is applied for two or more students.

Eventbrite - Plug-in Development with Dynamics CRM (November)

What is required to attend the workshop?

In order to be effective in this class, I need you to be knowledgeable in two things:

1. I need you to be a .NET developer, because we’ll be coding in C# and using Visual Studio to create our plug-ins.

2. I need you to know and understand Dynamics CRM. Without a firm grasp of how the product works, there is no way for you to create a plug–in that interacts with the Dynamics CRM system.

How about some goodies?

Did I mention that I’ll be giving you the same tools and templates that I use to do my own plug–in development? Well, I am. This will really jump–start your plug–in development efforts.

Got any questions?

If so, just let me know.

Want to hear what others have to say about this workshop?

Check out these comments from previous students":

I found Mitch Milam’s workshop to be a great way to jump-start my plug-in development. Besides presenting class material in such a way that it was easy to comprehend, Mitch also provided Visual Studio templates. These templates proved to be extremely useful because they take care of the necessary plumbing when writing plug-ins, speeding up the development time. Additionally, the labs we worked on in class covered real-life scenarios directly applicable to my day-to-day work. In fact soon after the workshop, I solved a business problem by building a plug-in that was based on one of the labs we worked on in class.

Natalya Pinsker, Baltimore, MD


Mitch’s Plug-in Development workshop helped me get out of the gate and a good way down the path of C# development for Microsoft Dynamics CRM – including both Plug-ins and Workflow Assemblies.

Mitch is an excellent instructor who responds to all questions and helps people along at their own pace.

I highly recommend this workshop for anyone who is looking to get into the Microsoft CRM development game. It will accelerate your process and save you more than enough time to pay for itself.

Aron F.


Your class was an eye opening experience. In addition to learning about Plug-In Development this class exposed me to so many other aspects of Microsoft Dynamics CRM that I was not aware of.

Marlon R. Joseph, Application Analyst III, Houston Baptist University

Next Steps

Ready to get your plug-in groove on?  If yes, then click the this button:

Eventbrite - Plug-in Development with Dynamics CRM (November)

Free Webinar Friday: Training Strategies to Increase Microsoft Dynamics CRM User Adoption

Hi Everyone,

Tomorrow I’m hosting a free webinar in conjunction with MSDynamicsWorld.  Here’s what we’re covering:

User adoption is always a concern when starting any new software project and Microsoft Dynamics CRM is no different. In this webinar we will discuss 7 training strategies to help increase the knowledge-level of your users, decrease frustration for both users and support staff, and generally help your project become a success.

Sign up here:

I hope to see you there.

Thanks, Mitch

Want to learn more about Developing Dynamics Plugins?

Hi Everyone,

My Dynamics CRM Deep Dive: Plugins book is in development and is available for pre-release purchase.

The book should be available in late October, but if you purchase now, you’ll receive:

  1. A $20 discount on the final e-book.
  2. The electronic resources that will accompany the book (as they are completed).
  3. Advanced copies of chapters for your own education as well as to provide feedback, should you feel so inclined.

Let me know if you have any questions or suggestions.

Thanks, Mitch

Free Webinar: Productivity Maximized using GoToWebinar and Click Dimensions

Hi Everyone,

This year I implemented a new program I call Teaching on Tuesdays where I hold free webinars on various topics ranging from Dynamics CRM, to Xamarin, to business and development best practices.  Averaging at least two webinars a month has allowed me to refine my work so that I have a repeatable process that I can follow each time.

Two of the tools I use on at least a weekly basis, if not daily, are GoToWebinar and Click Dimensions.

I use GoToWebinar (and GoToMeeting) to host all of my meetings and webinars and Click Dimensions handles everything from adding webinar participants to Dynamics CRM, to sending notification emails, to collecting additional information using forms and surveys.

In this webinar we will be discussing the following:

  • Setup and Configuration of the Click Dimensions GoToWebinar connector
  • Planning your webinar
  • Marketing your webinar
  • Reducing webinar SPAM (yes, there is such a thing)
  • Conducting your webinar
  • Recommended equipment
  • Collecting attendance statistics
  • Communicating with both registrants and attendees
  • Recording your webinar and publishing it to YouTube
  • Plus much, much, more

You’ll also receive a step-by-step guide that I have created which documents each of the steps required to plan, host, record, and follow-through with a webinar.

I hope to see you there.

Tuesday, Sept 15, 2015 11:00 AM – 12:00 PM CDT       Register Now


Thanks, Mitch

Dynamics CRM JavaScript: Ensure the current record is Saved before opening a new record

In yesterday’s post, Tracing the Dynamics CRM Form Data save Operation, I discussed identifying data that would be sent to the database when you saved a Dynamics CRM record.

Part of the issue I was facing was related to the form not completing the save operation before I opened a new form record. Since Dynamics CRM 2013 and 2015 user interface rarely opens a new window, the user was getting a warning that there was unsaved data when the page was being switched between the Account and, in this case, the Opportunity record.

So to prevent this from happening, I had to wait for the save to complete then open the new Opportunity record.

Here is the code where I do that:


var parameters = { customer_id: customerId, customer_name: customerName, customer_type: customerType, name: Xrm.Page.getAttribute("name").getValue() }; var windowOptions = { openInNewWindow: true }; setTimeout(function () { openNewForm(parameters); }, 2000); } function openNewForm(parameters) { var windowOptions = { openInNewWindow: true }; Xrm.Utility.openEntityForm("opportunity", null, parameters, windowOptions); }

The Details

We are using the JavaScript method setTimeout to wait for 2,000 milliseconds (2 seconds for those of us who are not computers).

At the end of the wait period, we will call a function called openNewForm which will use the Dynamics CRM method Xrm.Utility.openEntityForm, which opens a new Opportunity form.

You may need to adjust the wait period up or down, depending on your environment. The idea is to wait long enough for the save to complete, but not long enough to irritate the user.

Tracing the Dynamics CRM Form Data save Operation

I ran into an interesting issue this week where I was opening up a new Opportunity Entity form from the Account record via a Command Bar button.

The issue was that I was getting a warning that I was about to discard changes to the record I was leaving, and would l like to Continue or Cancel.

I verified all of the JavaScript and found that I was not performing any updates on form load, so there must be something else happening to modify a value on the form so that CRM thinks the record needs to be saved.

But what was being changed?

I thought about it for a bit and realized I could have CRM tell me what was happening, though a little known or used method called

Dynamics CRM, by and large, does not send unaltered data to the database when a Save occurs. By using getDataXml, I can see exactly which field or fields were being modified.


To implement this code, I created a small onSave method:

function onSave() {

Then created an OnSave event on the form properties:


Note: Make sure this event is the final OnSave event to ensure that all of the other OnSave events have completed.

This will display a message box showing what fields have been changed and the new values. Basically the same thing that will be sent to the database.


It turns out that in this particular case, I was programmatically:

  1. Setting a field value
  2. Saving the record
  3. Opening a new related record

The issue was that the Save operation had not completed so the field I had modified was still considered dirty.

This allowed me to correct that issue and now things work as expected.

Up Next

My next article will outline how to work around the saving of the record while navigating to another record issue I ran into above.

Free Webinar: Dynamics CRM Plugin Development Basics

Hi Everyone,

Just a reminder of my next free webinar:

Dynamics CRM Plugin Development Basics

In this webinar we will discuss the basics of Dynamics CRM plugin development including: What plugins do, how they are architected, the development tools you will need, and what it will take to develop your first plugin.

Tuesday, August 25th, 2015 11:00 AM – 12:00 PM CDT       Register Now


Thanks, Mitch