Answered by:
Error in webform on Create salesorder

Question
-
Hi,
I made a webform where user can enter their personal information (for entity contact), their business information (for entity account), and where users can select an opportunity. When clicking a button, a salesorder should be created, but I get an error.
This is the error:
Message: Server was unable to process request. Detailed information: -Errorcode: 0x80040216 (An unexpected error occurred.) -Description: An unexpected error occurred.
Is a 'salesorder' some special entity that needs special treatment? I have no problem creating other entities, but with salesorder I get this error.
Any help is much appreciated!
Best regards, Leonard
Wednesday, February 9, 2011 10:32 AM
Answers
-
This is very strange... I tried to reproduce your situation and following code created sales order for me:
salesorder so = new salesorder();
so.customerid = new Customer("account", new Guid("26C7A5F8-AD02-DE11-83DE-0003FFE51F61"));
Guid id = crmservice.Create(so);
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)- Proposed as answer by Andrii ButenkoMVP, Moderator Wednesday, February 9, 2011 12:52 PM
- Marked as answer by Leonard_Str Tuesday, April 19, 2011 9:57 AM
Wednesday, February 9, 2011 11:51 AMModerator
All replies
-
Try to handle SoapException and check Detail.InnerText property - this will give you detailed description of the error.
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)- Proposed as answer by Andrii ButenkoMVP, Moderator Wednesday, February 9, 2011 12:52 PM
Wednesday, February 9, 2011 10:39 AMModerator -
Thanks Andriy for quick replay. Detail.InnerText isn't a helpful message:
0x80040216
An unexpected error occurred.
PlatformI tried creating a salesorder without any attributes, this resulted in an unexpected error (0x80040216).
In CRM I saw that there are several mandatory attributes. I tried to create a salesorder with these attributes (name, customerid, pricelevelid, ispricelocked, transactioncurrencyid and ownerid), but then again: an unexpected error (0x80040216).
Wednesday, February 9, 2011 11:09 AM -
This is very strange... I tried to reproduce your situation and following code created sales order for me:
salesorder so = new salesorder();
so.customerid = new Customer("account", new Guid("26C7A5F8-AD02-DE11-83DE-0003FFE51F61"));
Guid id = crmservice.Create(so);
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)- Proposed as answer by Andrii ButenkoMVP, Moderator Wednesday, February 9, 2011 12:52 PM
- Marked as answer by Leonard_Str Tuesday, April 19, 2011 9:57 AM
Wednesday, February 9, 2011 11:51 AMModerator -
Dooooh!
I tried to add a customer as a lookup property instead of a custom property. Changed it to custom property and now it's working fine!
Thanks for your help Andriy!
Wednesday, February 9, 2011 12:49 PM -
Hey Leonard4p
IS this for CRM 2011 and IFD?
If so, how did you get ur webform to work with IFD. I keep getting a, The provide URi did not return any service end points!
cheers
Van Tay LeTuesday, April 26, 2011 2:21 PM