Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm encountering an error while submitting data using infopath forms to a sharepoint 2010 external list. The error only occurs if an external item picker control is used. This error does not occur in pre sp1 versions of sharepoint 2010 in our dev & test environments.

Event Viewer Error

There was a form postback error. (User: DIR\kpidev, Form Name: Template, IP: , Request: http://kpi-web/dataentry/Lists/Organization/Item/newifs.aspx?RootFolder=/dataentry/Lists/Organization&IsDlg=1, Form ID: urn:schemas-microsoft-com:office:infopath:entity:-AutoGen-2013-02-14T20:55:37:445Z,Type: SchemaValidationException, Exception Message: Schema validation found non-datatype errors.)

SP 2010 Log

02/20/2013 09:58:14.20 w3wp.exe (0x0128) 0x11DC SharePoint Foundation Web Controls 52ro Medium*ItemPicker: Exception occurred while calling FindSpecific: System.Runtime.Serialization.SerializationException: Attempting to deserialize an empty stream. at * System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at Microsoft.SharePoint.WebControls.ItemPicker.get_ExtendedData()
at Microsoft.SharePoint.WebControls.ItemPicker.get_EntityNamespace() at Microsoft.SharePoint.WebControls.ItemPicker.get_BdcEntity() at Microsoft.SharePoint.WebControls.ItemPicker.ValidateEntity(PickerEntity pe) 58502b0d-4692-4f42-8ec5-8eb39806dbc3 02/20/2013 09:58:14.20 w3wp.exe (0x0128) 0x11DC SharePoint Foundation General 72b7 Medium Error validating entity 1: System.Runtime.Serialization.SerializationException: Attempting to deserialize an empty stream.
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at Microsoft.SharePoint.WebControls.ItemPicker.get_ExtendedData()
at Microsoft.SharePoint.WebControls.ItemPicker.get_EntityNamespace()
at Microsoft.SharePoint.WebControls.ItemPicker.get_BdcEntity()
at Microsoft.SharePoint.WebControls.ItemPicker.ValidateEntity(PickerEntity pe)
at Microsoft.SharePoint.WebControls.EntityEditor.Validate(). 58502b0d-4692-4f42-8ec5-8eb39806dbc3 02/20/2013 09:58:14.20 w3wp.exe (0x0128) 0x11DC InfoPath Forms Services Runtime - Business Logic 82g1 Critical There was a form postback error. (User: DIR\kpidev, Form Name: Template, IP: , Request: http://kpi-web/dataentry/Lists/Organization/Item/newifs.aspx?RootFolder=/dataentry/Lists/Organization&IsDlg=1, Form ID: urn:schemas-microsoft-com:office:infopath:entity:-AutoGen-2013-02-14T20:55:37:445Z, Type:
SchemaValidationException, Exception Message: Schema validation found non-datatype errors.) 58502b0d-4692-4f42-8ec5-8eb39806dbc3

share|improve this question

1 Answer 1

Are you using code in the form to edit fields? This error is likely to happen when you assign a value to a nillable field.

You see, the InfoPath from is an XML so each field that doesn't have a default value will have an atribute "nil" in its correspoding XML tag.

Something like this:

<xsi:field  xsi:nil="true" />

Just use this method here to delete the attribute right before setting the field's value:

public void DeleteNil(XPathNavigator node)
{
    if (node.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
    {
        node.DeleteSelf();
    }
}

I hope it helps

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.