CRM SDK Nugget: SolutionId Value for the Active Solution

I’ve been working with solutions and web resources a lot lately so this next series of articles will focus on Solutions and Web Resources.

Importing an object into the Default/Active solution

Let’s pretend for a moment that you’re writing a utility that maybe converts your JavaScript from the CRM 4.0 object model into the CRM 2011 object model. Someone, at some point, is going to want to have that newly-converted code reside inside of CRM 2011 without a lot of manual labor.

Actually, it would be really neat if the tool could just import it directly as part of the post-conversion process.

This is actually not a huge issue since JavaScript Web Resources are database records like any other record within CRM.

The issue lies in the fact that Web Resources reside inside of a Solution, so you must know which solution to either query against or write to.

Normally, this would require you to query the solutions within an Organization to locate the solution you wish to use.  But what if you want to use the Default solution?

Lucky for us, it turns out the Default solution actually has a consistent SolutionId which will be the same across any CRM installation.

I found this little nugget in the CRM 2011 SDK, here. Let’s review the data:

We actually have two pre-defined SolutionIds:

Name Default
SolutionId

{FD140AAF-4DF4-11DD-BD17-0019B9312238}

Description

The Default solution does not contain any solution components. It contains references to all the managed and unmanaged solution components in the system.

   
Name Active
SolutionId

{FD140AAE-4DF4-11DD-BD17-0019B9312238}

Description

The Active solution represents the current published unmanaged customizations that define the behavior of the application.

 

The Default SolutionId, in all honesty, is mostly for reference, or so it seems to me.

The Active SolutionId is the one that you would use as a reference to query or insert objects into the Default solution.

Once an object, say a Web Resource, has been installed in the Default solution, can you always add it to other solutions using the Add Existing functionality of the solution explorer.

This may not seem like much, but it will save you at least one query to get the Default SolutionId and any time you can reduce the amount of code you have, the better.

Leave a Reply 1 comment