Monday, December 15, 2014

Incident.ResponsibleContactId is obsolete, replaced by PrimaryContactId

Found another interesting new wrinkle in CRM 2013/2015.  Apparently there has been a schema change on the Incident / Case entity, or at least a schema replacement.

I was rebuilding a Plugin that was originally developed with CRM 2011.  In the Plugin, there was an early bound reference to the system entity for Incident, where I was looking at the ResponsibleContactId.

Symptom:
When building the plugin Assembly, you get this error:


Warning 4 'xxxx.Incident.ResponsibleContactId' is obsolete  .....

Output Windows will show something like this:

.... warning CS0612: 'xxxx.Incident.ResponsibleContactId' is obsolete

If you browse the .cs file generated by CrmSvcUtil, you will see this in the line with the System.ObsoleteAttribute() added.

/// <summary> /// Choose an additional customer contact who can also help resolve the case. /// </summary> [Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("responsiblecontactid")] [System.ObsoleteAttribute()] public Microsoft.Xrm.Sdk.EntityReference ResponsibleContactId { .... }

So I had never seen System.ObsoleteAttribute() before, so naturally I Googled... uh, I mean, Bing'ed... the term to see what was up.

DotNetPerls had a pretty good explanation.

Still couldn't figure why Microsoft would obsolete this attribute, until I ended up on this page:


The key here is the Note at the beginning about the ResponsibleContactId being replaced by PrimaryContactId

The incident entity ResponsibleContactId lookup attribute should be considered deprecated and the PrimaryContactId lookup attribute introduced with the Microsoft Dynamics CRM 2013 Service Pack 1 (SP1) release should be considered the primary system lookup attribute to associate incidents with a contact record.
There are no plans to remove the ResponsibleContactId lookup attribute, but if you plan to create new customizations you should use PrimaryContactId rather thanResponsibleContactId. If you have existing customizations that currently use ResponsibleContactId, you should consider migrating them to use PrimaryContactId instead.

So, ResponsibleContactId will be around for a while, but is being replaced.

A lot of my PluginCode for the 2 CRM instances I manage uses this field, so I'm going to have to rework how those work, or just ignore the message for a while.  

Tuesday, December 2, 2014

Install CRM Developer Tookit in Visual Studio 2013 - Repost

I ran into this problem today trying to open a Plugin project on a PC that I hadn't installed the CRM Developer Toolkit on to yet.  Not sure why the SDK doesn't support VS 2013, which is now almost 2 years old?

I ran across this blog post with a fix, so I am copying it here.

(Edit: This was the original site, but it seems to be offline now? http://www.hashtagcrm.com/?p=79)

(Edit: New Site: http://torsteinutne.com/2014/03/24/getting-the-crm-developer-toolkit-to-work-with-visual-studio-2013/)

(Update: April, 2016:  I have tried this trick with Visual Studio 2015, but can't get it to work.  My recommendation for VS2015 going forward is to use the Dynamics CRM Developer Extensions developed by Jason Lattimer.)


If you’re anything like me, then you generally prefer to be using the latest and greatest technology, unless there is a tremendously compelling reason not to. You also dislike the inconvenience of having to use two different tools when one should be capable of everything you need.

For most people Visual Studio 2013 is not a huge change from 2012. There are a few minor visual differences, but it looks pretty much the same. There’s several convenience features, like the cloud integration that automatically loads your settings on any computer you log in to. Several new technologies were introduced in VS2013 such as MVC5 and WebApi 2.0, which I’ve recently started using and am not looking back. It’s got enough new changes that I strongly prefer it over 2012 and I would love to use it exclusively, except for one painfully obvious thing… The CRM Developer Toolkit.

A more patient person might just wait until a new version is released as part of the SDK. But then I thought about the CRM Report Authoring Extensions (*cough* *cough* *hint* *hint* Microsoft), that still hasn’t moved past VS2010. So I’m not going to hold my breath for this update. But VS2012 and 2013 are so similar, I’d doubt there’s any major compatibility issues for this little plugin. So let’s see what we can do:

Step 1 :

Extract the contents of CrmDeveloperToolsVS12_Installer.msi

  1. Open a Command Prompt as Administrator
  2. Navigate to: sdk\Tools\DeveloperToolkit\
  3. Run: msiexec /a CrmDeveloperToolsVS12_Installer.msi /qb TARGETDIR=<EXTRACTFOLDER>


Step 2 :

Modify the VSIX package

  1. Navigate to the folder which you extracted the files
  2. Open the Visual Studio folder
  3. Open the archive file Microsoft.CrmDeveloperTools.vsix (I used 7-Zip for this)
  4. Edit extension.vsixmanifest
  5. Replace: InstalledByMsi=”true” with: InstalledByMsi=”false”
  6. Replace all instances of: Version=”[11.0,12.0)” with: Version=”[11.0,12.0]“ (note the closing bracket changed)
  7. Update the file in the archive


Step 3 :

Install the package
Double click to install the VSIX package Microsoft.CrmDeveloperTools.vsix
Looks promising so far. Click Install.
Sweet! But does it actually work?

Step 4 :

Verify

  1. Start up VS2013 and create a new CRM Solution Project
  2. You should get the Connect to CRM window, and it should connect as normal
  3. Test out whatever you may use on a regular basis
  4. Profit.


So there you go! CRM Developer Toolkit in Visual Studio 2013. The best part is that it “just works”. It didn’t require any changes for compatibility, other than explicitly allowing it to be installed in VS2013.

So far everything I’ve tried is working perfectly, not a single hiccup. With this, there’s no more need to keep both versions of VS installed. Let me know in the comments below if this works for you too, or if you run into any features of the dev kit that’s not working yet in 2013.

I should probably put a legal disclaimer on this one. Of course this is not supported by anybody, and any harm that may come to you or your computer or anyone/anything else in the process of attempting these steps is in no way the responsibility of myself or of hashtagcrm.com.

UPDATE Feb 26, 2014: If you are running Visual Studio 2013 and 2012 on the same machine, you’re probably getting a: “Could not load file or assembly ‘Microsoft.Windows.Design.Host” error. To resolve this issue you must copy the contents of the CRM MSBUILD folder you extracted from the msi package to: C:\Program Files (x86)\MSBuild\Microsoft\CRM
Also, you must edit C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config, add the following lines:

<dependentAssembly>
<assemblyIdentity name=”Microsoft.Windows.Design.Host” publicKeyToken=”b03f5f7f11d50a3a” culture=”neutral” />
<bindingRedirect oldVersion=”4.0.0.0-4.1.0.0″ newVersion=”4.2.0.0″ />
</dependentAssembly>

Thanks to Eduardo for sharing that fix!

On a last note, if you have both VS2012 and VS2013, and you uninstall VS2012 that seems to cause additional issues that I have not resolved yet.

Wednesday, October 29, 2014

Performance Markers...who knew??

So this might not be news to some of you, but I stumbled on an interesting tool in CRM 2013 this morning.

In the course of my job, I have to capture a lot of screen shots, so I use a tool called SnagIt from Techsmith.  SnagIt is a great tool, and I highly recommend it, but that's not the point of the story.

I have SnagIt configured to start a screen capture when I select Ctrl-Shift-Q from the keyboard.  This morning I was looking at something in CRM 2013 I wanted to capture and mark up. I did the Ctrl-Shift-Q and to my surprise...this Performance Markers window popped up in CRM?




At first I missed it because SnagIt was capturing the screen without it, but when I exited the SnagIt capture, there it was.

Looks like it's showing the load times for the various functions on the page, and could be very useful in the future.  I searched, but all I could find was that you can use Alt-Shift-Q or Ctrl-Shift-Q to make the window appear.  I can't find any other documentation on how to use it, maybe someone else has seen it somewhere?


Sunday, October 26, 2014

Enhanced SLA's in CRM 2013/2015

I've been reviewing the new SLA capabilities in CRM 2015, but I've got to go through CRM 2013 first because we are still on 2011, which was upgraded from 4.0.

I had to build an entirely custom SLA system (although we call it TRT for 'Target Response Time') because this was not available in 4.0/2011.  

This new 2013/2015 system looks cool, and I like the idea of a timer control on the case to show the time left before the timer expires.

One of the main things I see in the new one is the 'pause' feature, which can come in handy.  Because we offer 24/7 support for several of our products, but after hours the support is done by a support analyst on-call, we have to manually calculate the the target for new cases that come in after 8pm ET, or on a weekend.  

Example:  Priority 3 case comes in at 9:00PM on a Wednesday night.  Target Response/SLA is 4 hours, but because it's after hours we don't set the target for 1:00am, we set it to 12 noon the next day because we open support at 8am the next day.

Wondering if CRM SLA system can work with this?  Guess I will find out as I research this new feature.

Saturday, October 25, 2014

Starting a new CRM project

Haven't written anything here for quite a while, I've been busy working on a customer facing portal project with CRM on the back end, and using ADXStudio CMS on the front end.

Now that is mostly finished, I'll be moving on to upgrade 2 separate instances of CRM from 2011 to 2013, and probably 2015 as soon as it comes out.

Already noticing a lot of changes to the UI that will be very difficult for the end users to adapt to.  The lack of navigation on the left side to get to related records, is weird.  I'm reviewing a tool from mscrm-addons.com called the SmartBar.

Should be an adventure!