CRM2011 OptionSetId Cannot be Changed when Importing Unmanaged Solution

I had an unusual problem today, I say unusual I mean irritating.

I had a solution which was unmanaged and I had imported it to an organisation.

I then worked on my solution further and at some point I decided some of the Option Sets should change from entity level to global option sets.

When I then exported my solution and tried to import it into the organisation which had an early version.

It failed, it gave the error

OptionSetId cannot be changed when importing

The only useful part of the error message was it told me it was an option set, it didn’t tell me which one.

It took me a while to work out which option set was causing me problems but in the end I removed and deleted most of them until I got the right one.

This forum post was quite useful for pointing me in the right direction.

It certainly is a good argument to use managed solutions rather than unmanaged, the ability to remove the solution before importing sounds very useful (not to mention the customer not being able to change anything).

I thought I would write a blog post about this because when I googled the problem, hardly anything came up.

CRM 2011 Solution – Shrpr Web Resource Editor

The file editor when editing Web Resources is as basic as they come in CRM 2011 (and all the previous versions).  It would be such a nice gesture for Microsoft to create an editor with a few basic features like syntax checking and formatting.

Microsoft have yet to do anything in this area so one someone got bored of waiting and has started the process by creating the Shrpr Web Resource Editor.   You can read more about the editor in this blog post and you can download the solution (a CRM solution which you can import) here  Downloads 

It has features like

Syntax highlighting

Line numbering

matching braces

simple code completion

 

When I imported the solution I couldn’t figure out where the editor was or if it did anything, this was because I went into a form and tried editing some Javascript.  Unfortunately there isn’t any documentation yet so you have to figure it out yourself.  After reading the title again, I went to Web Resource and then clicked on some javascript, you then see there isa new button on the top right to open the web resource with the editor.   Below is a screenshot

 

I think this is a really good start because syntax highlighting is very useful and the matching braces is fantastic.  Hopefully if people start using it and giving some feed back he will continue to work on the product.

So thanks Roman Gebesmair and keep up the good work

 

CRM 2011 Solution – Microsoft Dynamics CRM SiteMap Editor

I am seeing an increased amount of tools created as solutions which work within CRM.  This is a much tidier method of distributing CRM 2011 tools, it’s easy to find and easy to uninstall.

I have also noticed more useful solutions being available on the CRM marketplace, although I must admit I rarely look there.

This one is pretty good

Microsoft Dynamics CRM SiteMap Editor

http://dynamics.pinpoint.microsoft.com/en-us/applications/microsoft-dynamics-crm-sitemap-editor-12884928049

documenation

https://skydrive.live.com/?cid=cfb122124e1df171&id=CFB122124E1DF171%21125

CRM 2011 – error when importing solution

I was getting this error today whilst trying to import my solution

Error while Importing a solution in CRM 2011 – The solution file is invalid. The compressed file must contain the following files at its root: solution.xml, customizations.xml, and [Content_Types].xml

after about an hour of frustration the solution to the not importing solution finally struck me.

The problem was I was zipping up the solution folder, this then creates a zip file with a folder at the root and then the three solution files

Hosk Solution

[Content Types].xml

solution.xml

customizations.xml

 

What you have to do is select the three xml files and then zip them up.  This then doesn’t create the root folder.

This is definitely a “Monday Morning” error and it’s a pity CRM doesn’t have an root folder error which I’m guessing would save a lot of people a frustrating hour or so.

CRM 2011 – Understanding Solutions in CRM 2011

Solutions is one of the biggest development changes in CRM 2011 and it will take a little bit of time for people switching from CRM 4 to CRM 2011 some time to get their heads around it.

When you do you will find it is a massive improvement not only in terms of keeping only the changes you have made in a seperate solution but most importantly it’s a huge improvement in deploying CRM 2011.

For developers the way to understand solutions is basically to think of them like projects in Visual Studio.  You could almost think of each entity or section (processes, javascript etc) as a separate project adding into a visual studio Solution.

The good news is they are easy to learn and you will soon have mastered solutions and then you will wonder how you ever managed in CRM 4.  The biggest benefit I have found is its easy to keep track of your changes, particularly with javascript with the added bonus of you know being able to use the same Javascript with multiple entities.

Richard Knudson who is one of the leading CRM bloggers has written an introduction to Solutions and like most of his articles it’s is excellently written. You can read it here

Dynamics CRM 2011 Solutions, Part 1

if you prefer to learn by watching videos then the channel 9 series is probably the best ones I watched on the subject and they are by David Yack so you are in very good hands

Solutions – Introduction

Solutions – Introduction

Solutions – Managed & UnManaged

Solutions – Managed & UnManaged

Solutions – Publishing

Solutions – Publishing

 

 

CRM 2011 – Dynamics CRM 2011 Developer Training Videos

I found this brilliant set of videos regarding CRM 2011 Developer Training.

http://channel9.msdn.com/Series/DynamicsCRM2011/

Before I found a good youtube series from the Sonoma Partners, 10 videos containing the front end customizations and this highlights the changes you can make without doing any developing or code based solutions

but this new resource focuses on the new features in CRM 2011 in the development area.  It runs through things like solutions, the ribbon, plugins, linq, odata, WCF webservices, visualization, JQuery and silverlight.  It is a very extensive collection and only last week they added 6 more videos so it’s worth keeping an eye on this page.

Here is the list of current CRM 2011 Developer Training videos

Introduction to CRM 2011 Training Kit

Introduction to CRM 2011 Training Kit

Solutions – Data Modeling

Solutions – Data Modeling

Solutions – Introduction

Solutions – Introduction

Solutions – Managed & UnManaged

Solutions – Managed & UnManaged

Solutions – Publishing

Solutions – Publishing

UX Extensibility – Intro

UX Extensibility – Intro

UX Extensibility – Ribbon

UX Extensibility – Ribbon

UX Extensibility – WebResources

UX Extensibility – WebResources

Processes – Introduction

Processes – Introduction

Plugins – Registration & Diagnostics

Plugins – Registration & Diagnostics

Plugins – Introduction

Plugins – Introduction

oData endpoint

oData endpoint

LINQ Provider

LINQ Provider

Web Services – Entity Class & Querying

Web Services – Entity Class & Querying

Web Services – WCF Endpoint Intro

Web Services – WCF Endpoint

Visualizations – Dashboards

Visualizations – Dashboards

Visualizations – Charts

Visualizations – Charts

UX Extensibility – Filtered Lookups

UX Extensibility – Filtered Lookups

UX Extensibility – Client Scripting

UX Extensibility – Client Scripting

Processes – Workflow

Processes – Workflow

Processes – Dialogs

Processes – Dialogs

Processes – Performance & Versioning

Processes – Performance & Versioning

Role based UI

Role based UI

Field Level Security

Field Level Security

jQuery & oData

jQuery & oData

Silverlight & CRM – Part 1

Silverlight & CRM – Part 1

Silverlight & CRM – Part 2

Silverlight & CRM – Part 2

SharePoint & CRM

SharePoint & CRM

Azure AppFabric & CRM

Azure AppFabric & CRM

Windows Azure & CRM

Windows Azure & CRM

Upgrading from CRM 4.0 to CRM 2011

Upgrading from CRM 4.0 to CRM 2011

 

CRM 2011 – changes didn’t appear after importing solution

I imported my solution and everything went ok after I increased the time out.

Then I noticed that I couldn’t see some of the changes that should be appearing.

I went into the solution section and I could see all the  entities and the changes but why weren’t they appearing.

I hit the publish all customizations button and hey presto my changes appeared.

Just another little gotcha to watch out for

CRM 2011 – A time-out occurs when you import a solution in Microsoft Dynamics CRM 2011

We had developed a solution on CRM 2011 Beta release and for some reason Microsoft didn’t have an upgrade path from CRM 2011 beta to the CRM 2011 release 1.

So this means we had to do a brand new install of CRM 2011 Release 1.  So the work I had been doing on the beta I need to move onto the new server with release 1 on.

After setting up the new organisation, which you can read about here , I exported the solution and then when it came to importing the solution, it would get about 20 percent along and then would just hang there.

I checked the event log but there was nothing in there, so I turned on tracing and then I could see a whole bunch of timeout messages.

I started searching google for CRM and timeouts and get a few hits and this one was the most useful.  I have had this problem before where I have had to increase the OLEDBTimeout value.  This is how Microsoft describe the variable.  You should also read this forum posting where people are discussing the problem

The OLEDBTimeout value

The unit of the OLEDBTimeout value is seconds. By default, the OLEDBTimeout value is 30 seconds. The OLEDBTimeout value controls the SQL time-out value that is used for a single SQL query. The increased OLEDBTimeout value is useful when the SQL server is overloaded. Additionally, the query takes a longer time to process.

 

The problems I have had before was when an account was merging, the problem was the amount of sql queries in one transaction was bigger than the timeout setting, it would then roll back all the sql transactions which had run.

I used method 1 to resolve the issue, the one slight question I have is to why the recommend increasing the timeout to a one whole day, this doesn’t really sound like a great move but I will leave it that length for now.

To resolve this problem, use one or more of the following methods.

Method 1: Add the OLEDBTimeout and the ExtendedTimeout registry subkeys to increase the time-out values

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
  3. Right-click MSCRM, point to New, and then click DWORD Value to create a new DWORD value.
  4. Rename the DWORD value to the following value:
    OLEDBTimeout
  5. Right-click the DWORD value, and then click Modify.
  6. In the Edit DWORD Value dialog box, type 86400 in the Value data box, clickDecimal in the Base option, and then click OK.

    Note According to the requirement of the computer that is running SQL server and the number of customization files, the value can be larger than 86400. The value of 86400 is equivalent to 24 hours.

  7. Right-click MSCRM, point to New, and then click DWORD Value to create a new DWORD value.
  8. Rename the DWORD value to the following value:
    ExtendedTimeout
  9. Right-click the DWORD value, and then click Modify.
  10. In the Edit DWORD Value dialog box, type 1000000 in the Value data box, and then click OK.

    Notes

    • In the Value data box, you can type a value that is larger than 1,000,000. However, do not type a value that is larger than 2,147,483,647. This is hexadecimal 0x7FFFFFFF.
    • If this key already exists, notice the current value. After you have completed the import or the upgrade for Microsoft Dynamics CRM, set the value of this key back to the original value or delete the key if it did not previously exist. The default OLEDB timeout value is 30 seconds.

Method 2: Modify the parameters in two different Web.config files

  1. Click Start, click All Programs, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. Expand the server name, and then expand Web Sites.
  3. Right-click the Microsoft CRM v3.0 Web site or the Microsoft CRM v4.0 Web site, and then click Open.
  4. Right-click the Web.config file, click Open With, and then click Notepad.
  5. In Notepad, locate the following line.

    <httpRuntime executionTimeout="300" maxRequestLength="8192"/>

  6. Change executionTimeout=”3600″ and change maxRequestLength=”20000″.
  7. Save and then close the Web.config file.
  8. In the directory in which you opened the Web.config file, open the MSCRMServices folder.
  9. Right-click the Web.config file, click Open With, and then click Notepad.
  10. In Notepad, locate the following line.

    <httpRuntime maxRequestLength="8192"/>

  11. Change maxRequestLength=”20000″.
  12. Save and then close the Web.config file.

 

 

managed and unmanaged solutions in CRM 2011

I am currently reading about Solutions in CRM 2011.

The solutions are a great enhancement to CRM 2011 but they do have quite a few quirks or things to watch out for.  I’m sure these will become second nature in the future but at the moment when everything is new, you have to keep you wits about you.

The first thing I have noticed is a solution can be managed and unmanaged.  An unmanaged solution is one which you can change and modify.  This is basically how you will have the solution whilst you are testing and developing it.

A managed solution is a solution you don’t want anyone to change.

Another thing I was wondering about, what about plugin registration.  If you supplied a solution with plugin’s do you need to register the plugins.  The answer is yes, although you can include already registered plugins in the solution.  This seems a bit misleading to me and I haven’t quite figured out what you do if this was an app in the CRM market place.   Would he user have to register the plugin themselves or are we expected to write some code to do this programatically.

Managed solutions also cannot be exported.

Deleting a managed solution will uninstall all of the solutions components.

An interesting aspect of Managed Solutions is you can create properties to allow the user to customermize aspects of the solution.

Solutions can be layered and it matters what order you import solutions into CRM.

Solutions only include the changes which are different from the system.  This means you can merge solutions together.

if two solutions both change the same area then the last solution imported will be the winner.  Which is something to remember, especially if you want to layer solutions and try and modularise coding in CRM.

it’s interesting and the more I read about it the more the way it works makes sense.  but it certainly helps to read the SDK and articles about solutions