10 Dynamics CRM 2011 Tips for Beginners (and maybe some Pros)

When starting to learn a new product or technology, the first place I always go to get a feel for what I’m in for are the forums and blogs. Rather than believing the hype of the official training courses or marketing material (lies!), the real value is in the experience you get from using the product to do something in the real world.

With that in mind, here are 10 tips for Microsoft Dynamics CRM you are unlikely to find in the official documentation.

Tip 1 – Understand the database, but stay out of it (for the most part).

With good reason, Microsoft advises that you should stay out of the database. That’s why they have such a rich API that allows you to do pretty much everything that you can do in the UI.

However there is one scenario I have found where you might want to consistently discard this advice. If you have an existing entity that you want to add a field to,by default all records created prior to the new field being added will be null. This is fine to a certain extent. However, what if you want to default that field for the existing entity?  Yes, you could code code around this in reports, but depending on the real business requirement, you may not want this to be empty when the entity itself is actually viewed. One way to get around this is to run an UPDATE statement on the table to ensure that the reports don’t break.

For example, if you have added a new mandatory field called Policy Type (new_policytype), which is an option set, with the values Standard, Premium and Enhanced, with corresponding values of 100,000,000, 100,000,001 and 100,000,002 – you may want to default all existing types to Standard. If you didn’t do this, users would be forced to select a value every time they update a contact record.

Adding a new field

So how do we default this value for any records that have already been created?

  • Connect to the organisation database using SQL Server Management Studio
  • Looks for the view dbo.Contact – we will update the view here rather than the ContactExtensionBase table directly. The underlying data is stored in the ContactExtensionBase table however.
  • Run the SQL against the table – for this example it would be  :Update dbo.Contact set new_PolicyType = ‘100000000’ where new_PolicyType is null

Tada - the data is good!

Be careful. Backup and do all the sensible things you should do before you run this. Don’t forget your where clause!

Tip 2 – Enforce validation everywhere!

So you have added an entity, and you have decided that you want to restrict the values for a Whole Number, Floating Point Number, Decimal number or currency field. Yay!. You see that there is a minimum value field and a maximum value field. So you enter the details in there and everything works, no problems.

Tip 2

However, what if you subsequently write your own custom UI, or have other code that calls the web services to populate that field. Unfortunately, min/max values are only enforced at the presentation layer. If you have any other way of populating these values, via web services or such like, you should ensure that this validation is also in your code or presentation layer.

Tip 3 – Don’t trust the CEO

So you have a CEO or MD, or other quite senior figure in your Organisation who you are scared of, who figures that they know better than you. Because they are the boss, they want to be given FULL permissions on every organisation and child business unit in Dynamics. So, not wanting to get fired, you happily give them full permission to update/delete all records.

Then you get some support calls with people indicating that records have mysteriously disappeared. With some quick investigation you discover the CEO is responsible. Worse, he orders you to get the records back.

Cascade Delete

While it may initially seem reasonable to give more permissions to people higher up the organisation chart, in reality the opposite is true!. People at the bottom often need the most granular permissions, especially with regard to delete permissions. In this example, the CEO could have deleted an entity without understanding all the cascade rules which delete a lot of child records they didn’t intend to delete.

Tip 4 – Managed Solutions are not a silver bullet for migrating between environments.

Version control has never been easy. With earlier versions of MS Dynamics, there were often a lot of disparate components that had to be moved separately, and manually between environments. Things have improved. When you start looking at CRM 2011 and the new solution functionality, most people look at Managed Solutions, and think that is what they should be using all the time. When you are first learning about Solutions, it seems like managed solutions sound like what you should do when moving code between Environments.

Managed Solutions

If you go down this road, you are likely to find out that these can be very hard to maintain. If you ever have problems importing solutions (there are some bugs!) you may find yourself in the situation that a managed solution has to be deleted completely. If you do this all the data associated with it will go too and then you have a mini-migration project on your hands! Best practice is to use Managed Solutions for productised solutions, but in a normal project type delivery, use unmanaged solutions between environments, and have normal procedures in place to manage the move between environments.

Tip 5 – Don’t use global Option Sets – use Entities.

While there are benefits to Global Option sets, the downsides are that developers typically have to update them, as opposed to users being able to update them. You don’t want the customer to have to raise a support call every time they want to do something this simple. Additionally, dropdowns are not very user friendly when there are lots of values in them. If there is a need for them to be hidden or disabled, it’s not possible to deactivate them.

Entity Lookups instead of Option Sets

So, as a general rule, don’t use option sets. Instead, create a new Entity, add entities with a name only and create a relationship. Users can now update these and values can be activated and deactivated as needed.

Tip 6 – Open Popups in new tabs.

When you are developing or customizing Dynamics, you’ve probably got enough windows open already. So when you start testing, you don’t want to start adding more and more popups.

This is a simple tip. I’m always surprised how many people don’t know how to do this.

IE Settings

Open IE. Change IE settings to open popups in new tabs. Tools -> Internet Options -> Change how web pages are displayed in tabs -> Always open popups in a new tab.

Enjoy your less cluttered desktop.

Tip 7 – Stop logging off and on again when testing

Don’t log off and back on again every time you want to test your Dynamics code / configuration as a different user.

I’ve seen developers waste 10 minutes logging in and out of Windows on their developer machine to test functionality that is only applicable to a specific user or users. You may have had to do this on a training course, but this is not necessary in real life!

Run as User

Just do this:

  • Shift Right Click on Internet Explorer
  • Click on Run as User
  • Enter the username and password of the user you want to test with.

This opens IE in a separate process. You can even leave your ‘System Administrator’ IE session open and make authorisation changes and permission changes and watch them take effect in the browser window.

Tip 8 – Fire a Plugin direct from the Ribbon Button

So, you might have a specific need to do something from an entity form – for example, you might want to validate the contents of a form prior to submission. The problem is, you don’t want the form to be saved and javascript just won’t cut it. Why does Dynamics not allow you to fire a synchronous pre-plugin from the toolbar.

Well, now you can fudge it. How? Just add a button to the ribbon to update a hidden field in a form with a pre-specified value. Have a plugin that looks at the value of the hidden field. Now you are effectively able to trigger a plugin from the form, just like a workflow activity!. (Note : I may write this up in more detail in future, so let me know if this interests you). For now, understand that this option is available to you at design time.

Tip 9 – Organise your web resources.

When adding web resources, if you’re like me, it’s a means to an end. You’d rather be doing something more interesting. So typically you pick a name for the resource and upload it and never think about it again.

While this is fine if you don’t have many web resources, once you have thousands you will be cursing yourself.

Next time,  use prefixes for web resources that denote the web resource type e.g.

  • \img\myimg.gif
  • \content\myhtmlpage.html
  • \scripts\myjavascript.js

There is obviously no real directory structure here, but when you have 1000s of web resources uploaded, this will make things infinitely easier to find in the web interface.

Tip 10 – Record things to do after a new install. Document your own ‘best practice’.

Once you get used to configuring Dynamics, you will find that some out of the box settings are so wise in the real world. Make a list of the settings you typically change on a fresh install, based on past experience.

Some of mine for example are:

  • Contacts have many searchable fields. Remove those fields you don’t need. You can do this by bulk editing fields in the GUI.
  • Turn Duplicate detection warnings off. Users generally don’t understand what it means and it’s confusing because it gives warnings on updates as well as creates.
  • Email Settings – Turn on – Allow messages with unresolved e-mail recipients to be sent.
  • Disable most Outlook settings or increase timings because of performance and security concerns.
  • In User settings, disable the email setting to automatically create records in Microsoft Dynamics CRM.
  • Remove workflow create permission from all users. When hundreds of end users create their own workflows, things can start getting out of control very quickly.
  • Disable views for out of the box entities for those views that you don’t need (e.g. Campaigns / Sales). Having lots of irrelevant views presents a bad user experience for the user.

These are my tips. What are yours?

One thought on “10 Dynamics CRM 2011 Tips for Beginners (and maybe some Pros)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s