When registering steps for plugins, you are given the option to select the user the plugin should run as. Your options are bascially calling user or any CRM system user for the organisation you are registering the plugin for. By running the plugin in the context of a user you take onboard that users privilages. For example, if you registered a plugin that creates an account within the context of calling user, and my user triggers the plugin, an account will be created in my name. However if my user doesn’t have permissions to create an account, but we need it to create an account on this trigger we have a slight problem. The plugin will fail creating the account! We can’t change my security roles to allow the creation of accounts as I should not be able to do this. So our only option is to run the plugin in the context of a user that can create accounts. So lets say we have an Administrator user that we will run in the context of. Well now we have introduced the problem that I actually want to talk about!
While testing importing of several small managed solutions I was able to create what is known as a circular reference in software engineering. Take it from me this is bad! When referencing assemblies in Visual Studio it prevents you from creating the circular references, however in MSCRM 2011 it doesn’t seem to prevent and if it does I managed to create a situation where it allows you to create the circular reference. So for MSCRM 2011 I am going to dub this as a circular dependency. Once the circular dependency was created I couldn’t delete or update either solution because they were dependant on each other!
Sometimes you may find yourself in a situation where a CRM system user record is no longer pointing to your Active Directory user. This broken link basically prevents the user from accessing CRM! Not good! In my experience this occurs due to the infrastructure IT bods not being fully aware of CRM and how it is tied to AD. So while managing AD they may delete users to keep things nice and tidy. While doing this, for example, they may accidentally delete the wrong AD account, recreate it and think everything will be OK, or they may delete someone who has left the business and a few months later the person is recruited back in to the business. I’m sure you can think of other reasons why the link between CRM and AD users might become broken but the effect is always the same… The user can’t access CRM anymore! So lets fix this with an example.
This statement holds true whether you are updating attributes through the SDK dlls or over web services. It doesn’t matter whether you’re coding for a plugin, workflow assembly, Silverlight app or some external custom application like a windows application or web application. The potential outcome in all the scenarios will be the same! What’s the outcome? Triggering other automation unwantedly!
I have had a excellent week working on my toolkit. I feel like I’m really starting to make progress on my main application. This week I have been working hard on the foundations again but things are really starting to take shape. Features are becoming easier to reuse and the development is starting to speed up because of it. The best part about the development is that because its following the MVVM design pattern theres a nice separation between UI and Logic. For the developers reading I have no code behind in my views, and my views contain little XAML! Happy Days! For you none developers that means when the new version of MSCRM comes out it will be easier for me to adapt the toolkit to interface with it!