Error when clicking save on EntityEditor.ascx

Jun 17, 2009 at 4:02 AM

Hi,


I have created a custom entity. There is no mandatory field in this custom entity except "name" field.
I have successfully displayed the form for this custom entity using Eservice EntityEditor complete with its picklist.

 

the form

 

I just add this code on my on_load method of my aspx page:

protected  void Page_Load(object sender, EventArgs e)
    {

        //check id
        string id = Request.QueryString["id"];
        if (!String.IsNullOrEmpty(id))
        {
            refFormEditor.EntityId = new Guid(id);
        }

        refFormEditor.EntityName = "new_referralform";
        refFormEditor.SavedRecordUrl = "AddReferralForm.aspx";
       
    }

 

 

Unfortunately, when I clicked save, there is an error:

Server was unable to process request. body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

Server Error in '/CRMCustomerPortal' Application.

Server was unable to process request.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Services.Protocols.SoapException: Server was unable to process request.

Source Error:

Line 397:				}
Line 398:                
Line 399:                EntityId = ((CreateResponse)_crmService.Execute(createRequest)).id;
Line 400:                
Line 401:			}


Source File: c:\Program Files\Microsoft Dynamics CRM Customer Portal\Controls\EntityEditor.ascx.cs    Line: 399

Stack Trace:

[SoapException: Server was unable to process request.]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +551452
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
   Microsoft.Crm.SdkTypeProxy.CrmService.Execute(Request Request) +47
   Controls_EntityEditor.SaveEntity() in c:\Program Files\Microsoft Dynamics CRM Customer Portal\Controls\EntityEditor.ascx.cs:399
   Controls_EntityEditor.updateButton_Click(Object sender, EventArgs e) in c:\Program Files\Microsoft Dynamics CRM Customer Portal\Controls\EntityEditor.ascx.cs:168
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

 

Is there something I should do?
Please help, it's quite urgent here.

Thanks
Esar

 
Jun 17, 2009 at 7:24 AM

Hi,

I've tried to provide soapexception trap to line 399. Here is the detail error

<error><br>  <code>0x80040203</code><br>  <description>serializedForm</description><br>  <type>Platform</type><br></error> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

Server Error in '/CRMCustomerPortal' Application.

<error>
 <code>0x80040203</code>
 <description>serializedForm</description>
 <type>Platform</type>
</error>

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: <error>
 <code>0x80040203</code>
 <description>serializedForm</description>
 <type>Platform</type>
</error>

Source Error:

Line 402:                catch (System.Web.Services.Protocols.SoapException e)
Line 403:                {
Line 404:                    throw new Exception(e.Detail.InnerXml);
Line 405:                }
Line 406:                

 

 

I have also  turned  the service trace on. There are 4 error entries which happen simultaneously  there.:

 

1.

at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
>CrmSoapExtension detected CrmException:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Microsoft.Crm.CrmArgumentNullException: serializedForm ---> System.ArgumentNullException: Value cannot be null.
Parameter name: serializedForm
--- End of inner exception stack trace ---
at Microsoft.Crm.Exceptions.ThrowIfNull(Object parameter, String name)
at Microsoft.Crm.BusinessEntities.CrmDateTimePropertyConverter.InternalToBusinessEntity(ICrmConversionContext conversionContext, AttributeMetadata attributeMetadata, Property property, BusinessEntity businessEntity, Dictionary`2 abbrvToChildAttributeMetadata, Guid organizationId)
at Microsoft.Crm.BusinessEntities.PropertyConverterBase.ToBusinessEntity(ICrmConversionContext conversionContext, AttributeMetadata attributeMetadata, Property property, BusinessEntity businessEntity)
at Microsoft.Crm.BusinessEntities.DynamicEntityToBusinessEntityConverter.Convert(ICrmConversionContext conversionContext, DynamicEntity dynamicEntity)
at Microsoft.Crm.BusinessEntities.BusinessEntity.Converter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at Microsoft.Crm.BusinessEntities.ConversionHelpers.Convert(ICrmConversionContext conversionContext, Object source, Type destinationType)
at Microsoft.Crm.Sdk.DictionaryMapper.Map(PropertyBag inputs, ICrmConversionContext context)

 

 

2.

>SOAP Request failed:
Url:http://msptestcrm:5555/MSCRMServices/2007/CrmService.asmx
MethodName:Execute
Response:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. ---&gt; serializedForm ---&gt; Value cannot be null.
Parameter name: serializedForm</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

 

 

3.

at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
>MessageProcessor fail to process message 'Create' for 'new_referralform'.

 

4.

at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
>Crm Exception: Message: serializedForm, ErrorCode: -2147220989, InnerException: System.ArgumentNullException: Value cannot be null.
Parameter name: serializedForm

 

 

i realized all of this error message refer to a null value which are not allowed. But I dont know what it is?!

There is no mandatory atributte in my custom entity except name. And I  have included name in the form and fill it.

 

any of you experience with this please?

any help will be very appreciated.

 

Thank before

Esar

Jul 9, 2009 at 1:14 AM

Probably a bit late, but I'm guessing the offender is a datetime field (Perhaps claimant DOB?). The EntityEditor does not explicitly mark empty CRMDateTime fields as null.

Jul 9, 2009 at 1:29 PM

Thank you for the assist.  I figured it out after I sent the message.  It needed changes in the tool menu customization settings.

Mimi

From: kometes [mailto:notifications@codeplex.com]
Sent: Thursday, July 09, 2009 1:15 AM
To: La Bella, Mimi
Subject: Re: Error when clicking save on EntityEditor.ascx [crmaccelerators:59744]

From: kometes

Probably a bit late, but I'm guessing the offender is a datetime field (Perhaps claimant DOB?). The EntityEditor does not explicitly mark empty CRMDateTime fields as null.

Read the full discussion online.

To add a post to this discussion, reply to this email (crmaccelerators@discussions.codeplex.com)

To start a new discussion for this project, email crmaccelerators@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Jul 21, 2009 at 6:44 PM

Good Day

 

I am experiencing the same issue when i have added on a nvarchar to the configuration.xml and give it a default value. When i go to view my cases it shows up fine but as soon as i try to save an entry it gives me “Server was unable to process request”  error. I have also updated my App_WebReferences to include all latest customizations and don’t know why it does not accept any customized fields.

It just falls over on the “EntityId = ((CreateResponse)_crmService.Execute(createRequest)).id;” code Controlls entity editor and function SaveEntity();

 

Please help.....