I am using Intuit QBO SDK v3 Intuit.Ipp.QueryFilter.QueryService(Of Bill) to get a collection of Bills filtered by Bill.Id. The collection is populated successfully. I want to modify just the BillableStatus of some of the ItemBasedExpenseLineDetail members of a Bill and update it with Intuit.Ipp.DataService.DataService.Update(Of Bill). Whether I actually modify any properties of the Bill or not, the Update method generates the following error:
Intuit.Ipp.Exception.SerializationException: There was an error generating the XML document. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Value of ItemElementName mismatches the type of System.Decimal; you need to set it to Intuit.Ipp.Data.ItemChoiceType.@UnitPrice. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBill.Write163_ItemBasedExpenseLineDetail(String n, String ns, ItemBasedExpenseLineDetail o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBill.Write181_Line(String n, String ns, Line o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBill.Write185_Bill(String n, String ns, Bill o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterBill.Write186_Bill(Object o) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(Stream stream, Object o, XmlSerializerNamespaces namespaces) at Intuit.Ipp.Utility.XmlObjectSerializer.Serialize(Object entity) --- End of inner exception stack trace --- at Intuit.Ipp.Utility.XmlObjectSerializer.Serialize(Object entity) at Intuit.Ipp.Core.Rest.RestHandler.PrepareRequest(RequestParameters requestParameters, Object requestBody, String oauthRequestUri) at Intuit.Ipp.DataService.DataService.Update[T](T entity)
The values of all the ItemBasedExpenseLineDetail members of the Bill seem to properly be Intuit.Ipp.Data.ItemChoiceType.UnitPrice as shown by a Watch or Immediate Window, for example:
?DirectCast(qboItem.Line(0).AnyIntuitObject, Intuit.Ipp.Data.ItemBasedExpenseLineDetail).ItemElementName
UnitPrice {2}
Any ideas how to perform the update without this error or where to look further?