OptionSetId cannot be changed. EnumAttributeInfo.AttributeDescription.OptionSetId(089e077e-6055-446a-ad6e-326f0bee7c9c) != c0864f8b-2c13-e411-93ed-000d3a800961


We got this error while importing the solution. This issue is caused by having an optionset with same name but different guid.

The solution is to identify the field and delete it from the org where we are importing.

select name from optionsetview where optionsetid = ‘c0864f8b-2c13-e411-93ed-000d3a800961′ (the 2nd guid)

The helpful post



CRM 2013 New and Beautiful getClientUrl() method instead of getServerUrl()


Originally posted on Sanghamitra Samantaray:

In CRM 2013 Microsoft has introduced this new client context method called “getClientUrl”

This is the replacement to the previous method called “getServerUrl” that was present in CRM 2011.

This method was faulty because it always returns the server name in the URL as it is set up in the CRM deployment manager, irrespective of how the host url looks like.

this is issue in scenarios where users might have invoked CRM using the server IP address or fully qualified domain name etc.

because when in the java script we call getServerUrl it does not return the URL with the server name as it was used by the calling the host url, but that of what is stored in the server, which fails , in the situations where the server name is not accessible from the host machine but the IP or fully qualified name.

in order to correct this…

View original 125 more words

Fix: Invalid ‘where’ condition. An entity member is invoking an invalid property or method while using LINQ in CRM 2013.



We were writing a LINQ query to get the contract record information by passing in the lawyer name. The lawyer is a lookup in the contract record.

So we were using contract.lawyerid.Name field of lookup in our where condition.

However we got the below error while doing so..


It seems like the LINQ Implementation for CRM doesn’t correctly interpret the lookup field’s name if we are using it in the where clause.

The solution was to do a join between the entities and then use the where condition against the lawyer entity username field itself.

Hope it helps..

CRM 2013 Tool – CRM 2013 One Click Navigation


Nishant Rana:

Fixes some of the navigation issues in CRM 2013..

Originally posted on Hosk's Dynamic CRM Blog:

Gather round children Uncle Ben is going to tell you a story.

Once upon a time Microsoft updated it’s CRM version from CRM 2011 to CRM 2013 and during this process removed the popular left hand navigation and replaced it with a better looking but much harder to use new navigation.  Highlights of the new navigation

Top menu disappearing just as  you try to go to it (this has been fixed a bit in the latest rollup because it stays there longer)

impossible to find Advanced find button

a smaller command bar with only room for 5 items (bumped up to 7 in the latest release)

To speed this story up,  Rockton Software commissioned a contest to see who could create the best solution to help the CRM 2013 navigation.   CRM MVP’s from all the land flocked round to battle it in a winner takes all ($5000 reward).  You…

View original 340 more words

Serialize and Deserialize InfoPath form and extract the attachment using WebClient in C#



Suppose this is our InfoPath form

First we will generate the class for the above InfoPath form


The sample code

myFields invoice = null;
WebClient webclient = new WebClient();
webclient.UseDefaultCredentials = true;

using (Stream fileStream = webclient.OpenRead("http://server:5000/formlibrary/FirstForm.xml?NoRedirect=true"))
if (fileStream != null)
XmlTextReader reader = new XmlTextReader(fileStream);


XmlSerializer xser = new XmlSerializer(typeof(myFields));
myFields invoiceInfopath = (myFields)xser.Deserialize(reader);
byte[] b = invoiceInfopath.field2;

// filename
int nameBufferLen = b[20] * 2;
byte[] fileNameBufffer = new Byte[nameBufferLen];

for (int i = 0; i < nameBufferLen; i++)
fileNameBufffer[i] = b[24 + i];

char[] charFileName = UnicodeEncoding.Unicode.GetChars(fileNameBufffer);
string fileName = new string(charFileName);
fileName = fileName.Substring(0, fileName.Length - 1);

// attchment
byte[] fileContent = new byte[b.Length - (24 + nameBufferLen)];

for (int i = 0; i < fileContent.Length; i++)
fileContent[i] = b[24 + nameBufferLen + i];

FileStream fs = new FileStream(@"C:\test\" + fileName, FileMode.Create);
fs.Write(fileContent, 0, fileContent.Length);

Hope it helps.