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
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..
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;
int nameBufferLen = b * 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);
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.