CRM 2013 Solution Export Issue

Recently I was having problems exporting a solution from an on-premise CRM 2013 organisation. Unusually there was no additional log to download and turning on verbose logging allowed me to see the exception being thrown on export but there was no indication to the source of the error.

I eventually resolved the problem by process of elimination, removing likely candidates from the solution until I could export successfully. It turned out to be an errant Routing Rule Set which was configured for forwarding to a queue but the queue wasn’t defined. Since you can’t create a rule and forward to a queue without defining the queue, I assume it must be due to the solution having originally been imported unmanaged and the queue name defined in the Rule Set not existing on import.

If you’re struggling with a solution export, import or delete I’d recommend verifying the Routing Rule Sets and Case Creation Rules first.

| Leave a comment

CRM 2013 Issue – systemform With Id = {guid} Does Not Exist

Solution Import Error systemform With Id = {guid} Does Not Exist

I was struggling with this error recently whilst trying to import a managed solution into a CRM 2013 SP1 integration environment.  It turns out that the form that it was telling me didn’t exist was a Quick Form that did!

Having confirmed the form existed in the org and solution I exported from I decided to open up the zip file to have a look through the customizations.xml file. I searched for the guid and could see that the Quick View form was as expected included correctly and the reference to it from the related form was also included.

The only thing I could think was that the form that referenced the quick view form was included in the Xml before the actual form that contained the quick view definition. I moved the element containing the quick view form above the that was referencing it, repackaged and tried again. This time the import work successfully!

So:

1. Open up your solution zip and edit the customizations.xml file searching for the guid provided in the solution import error log.

2. For each <Entity> that uses the Quick Form you’ll see it contains a <QuickFormIds> element similar to that shown below.  You need to make sure that the <Entity> element for the entity it refers to (xyz_entityName in this case) appears in the file BEFORE the <Entity> that is referencing it via the QuickFormIds element.

<QuickFormIds><QuickFormId entityname=”xyz_entityName”>33d82ce4-0648-477c-a1b8-08ddd4b6e5be</QuickFormId></QuickFormIds>

Looks like a bug that will hopefully get sorted in the next rollup.

| Tagged | Leave a comment

Configuring visual diff and merge tools for git on Windows

There’s plenty of information available on the net for configuring your visual diff/merge tool of choice for git. However, a lot of it is out of date. As of Jan 2014 using git v 1.8.4 this is the concise guide to setting up your visual diff and merge tool(s) of choice.

Add the following to your .gitconfig. If you don’t know what that is go here.

[diff]
   external = C:\\Program Files\\Perforce\\p4merge.exe
    tool = p4merge
[difftool "p4merge"]
    cmd = p4merge.exe $LOCAL $REMOTE
[difftool]
    prompt = false
[merge]
    tool = p4merge
[mergetool "p4merge"]
    cmd = p4merge.exe $BASE $LOCAL $REMOTE $MERGED

I’m using p4merge by Perforce. It’s free and supports the git three way merge well. If you want to use any other tool of choice add it to your path and replace the references to the .exe accordingly.

| 1 Comment

Avoid storing Nuget packages in your Git Repository

Git is a fantastic version control system but it was never designed for storing binary files. They clutter the history and even if removed that history must still be maintained. Ideally a remote pull should be a fast and pain free operation; one of the core tenets of git is speed. Something that anyone who has spent any amount of time within TFS will appreciate.

The screenshot below shows the packages folder of a newly created ASP.NET MVC 4 project. I appreciate some of these are scripts but that’s 47MB (before adding any project specific packages such as DI or Mocking) of binary data your git repo needs to maintain history for, binary history that you’re unlikely to ever care about.

You may now be thinking “What if we need to revert to an earlier build?”.  You can still do this using the exact same binary versions as when you created the commit. Simply check out the commit and build the solution as normal. Your packages will be restored to the exact versions at the time of the commit because the packages.config file which defines the versions of those packages is stored in your repo.

Let’s fix this…

  1. Enable NuGet Package Restore by right clicking on your VS solution. This will as the name suggests ensure on build of the solution that all package dependencies are pulled in from the configured nuget repositories. What to restore is defined in the packages.config file which is stored in the root of each project in the the solution. As mentioned earlier these will be version controlled which is what allows us to always restore source and package dependencies for any commit in the history. More info on this feature is available on the NuGet website.

  1. Add the line packages/ to your gitignore file. This is the important bit and something a lot of people forget to do.
  2. Commit the changes to the repo.
  3. That’s it we’re done!

Make sure you do this BEFORE the initial commit to the repo.

| Tagged , | Leave a comment

CRM 2011 SDK Dependency Starter now on Nuget

Each time I want to create a quick project in Visual Studio to connect to CRM 2011 I head to the SDK and pull in Microsoft.Xrm.Sdk then the source code for the helper classes and finally resolve all the missing framework dependencies IdentityModel, DirectoryServices etc.  The latter being made considerably easier with Resharper.

I’ve been meaning to package up this process that I’ve now repeated far too many times and throw it up on Nuget.  I finally managed to find the huge 10 minute commitment it eventually took to get this done tonight.

Available on the gallery or to install the package in Visual Studio just open up the Package Manager console and type:

install-package CRMSDKDependencyStarter

or for those of us averse to typing you can shorten this with:

install-p [tab] crm [tab] 

| Tagged | Leave a comment

Taking Team Foundation Service for a quick spin

Having just watched Brian Keller’s talk at //Build online I decided to give the new Team Foundation Service offering a spin. It’s free for teams of up to five users and whilst in preview also free for larger teams. No confirmed pricing plans yet so let’s hope MS don’t go silly if they really want to complete with the likes of GitHub and AppHarbor.

Setup is an absolute breeze having just created an account with my Live ID I was able to create a Team Project and start creating tasks in seconds. Make sure you pick your org name carefully as it cannot be changed at a later date. It also forms part of your URL so company name will be the obvious choice over a specific project name.

Hooking into Visual Studio 2012 is equally easy using the Team Explorer dialog to add a new server you just enter your URL http://xyz.visualstudio.com and you’ll be prompted for Live ID and you’re up and running. I just tried creating a task, pushing it to Outlook (2013) and following the link to view online and all went well. Having been through the pain of setting up an on-premise TFS environment including the SharePoint, SQL Reporting and Build Controllers this is a real step forward for smaller teams and I’ll definitely be digging in a lot more.

In an upcoming post I’ll be taking a closer look at the Azure Continuous Deployment Build Definition and comparing this with the new Continuous Deployment offering for GitHub and CodePlex integration introduced to Azure Websites recently.

If you want to try out any of the new Azure features head over to the Azure Website and sign up for the 10 free Azure Websites offering. Alternatively, if you’re a Microsoft Partner you can sign up for Cloud Essentials for your Azure access and whilst you’re there why not get on board with CRM 2011 Online and Office 365 partner access.

| Leave a comment

Windows 8 – Import pictures directly to a custom SkyDrive folder

If you want to import pictures from a camera or any other USB device straight to a custom SkyDrive folder you can’t do this using the Windows 8 Photo Application. By default it will import all photos to your picture library which won’t be linked to your SkyDrive folder. Whilst you can then upload the imported pictures to SkyDrive manually, this will duplicate the content, it’s far too time consuming and it will also incur the extra download from the SkyDrive servers to sync back with your local SkyDrive folder! There must be a better way.

I’ve fixed this by setting up my pictures library to point straight to the pictures folder within my local SkyDrive folder (which is stored on a second hard disk rather than my SSD where space is always at a premium). That way you’re importing from USB straight to SkyDrive all through the new Windows 8 Photo Application.

  1. Open Windows Explorer (Win + E)
  2. Move all of your pictures from Libraries\Pictures to the folder of your choice within your SkyDrive folder. For most people this will be the default Pictures folder you are provided with SkyDrive.
  3. Right click on Libraries\Pictures and select Properties

  4. Select the path to the current pictures folder most likely C:\Users\username_000. I don’t like the way Windows 8 creates these folder names when using Windows Live for your login.

  5. Click Remove
  6. Click Add
  7. Navigate to the pictures folder within your SkyDrive folder you just moved all your pictures to
  8. Click Include Folder

  9. Click OK.

  10. Click OK.

You now have the Windows 8 Photo Application importing directly to your SkyDrive.

You can also hide the Picture Library from the photo app as this is now just duplicating your SkyDrive folder. Open the charms menu (Win + C) inside the Photo App. Select Settings, Options and uncheck Picture Library. Alternatively you could setup a new “Local” picture library as I have done for importing/storing images you don’t want synced to the cloud.

| 1 Comment