We are trying to add write back feature in our application. We are using Java SDK. We trying two ways to update an existing customer
Method 1
- Retrieve the customer object using customerQuery
- Use th same customer object to update
- Successfully updated.
Method 2
- Create new customer object
- set Id using SetId() method for the newly created object
- update customer
- Getting following exception
-2001Error Detail :: cvc-complex-type.2.4.a: Invalid content was found starting with element 'MiddleName'. One of '{"http://www.intuit.com/sb/cdm/v2":SyncToken, "http://www.intuit.com/sb/cdm/v2":MetaData, "http://www.intuit.com/sb/cdm/v2":ExternalKey, "http://www.intuit.com/sb/cdm/v2":Synchronized, "http://www.intuit.com/sb/cdm/v2":AlternateId, "http://www.intuit.com/sb/cdm/v2":CustomField, "http://www.intuit.com/sb/cdm/v2":Draft, "http://www.intuit.com/sb/cdm/v2":ObjectState, "http://www.intuit.com/sb/cdm/v2":PartyReferenceId, "http://www.intuit.com/sb/cdm/v2":TypeOf}' is expected. com.intuit.ds.qb.IDSException: Error (-2001): cvc-complex-type.2.4.a: Invalid content was found starting with element 'MiddleName'. One of '{"http://www.intuit.com/sb/cdm/v2":SyncToken, "http://www.intuit.com/sb/cdm/v2":MetaData, "http://www.intuit.com/sb/cdm/v2":ExternalKey, "http://www.intuit.com/sb/cdm/v2":Synchronized, "http://www.intuit.com/sb/cdm/v2":AlternateId, "http://www.intuit.com/sb/cdm/v2":CustomField, "http://www.intuit.com/sb/cdm/v2":Draft, "http://www.intuit.com/sb/cdm/v2":ObjectState, "http://www.intuit.com/sb/cdm/v2":PartyReferenceId, "http://www.intuit.com/sb/cdm/v2":TypeOf}' is expected.
Method 1 is working perfectly. But have i susses with method 2. Is the first method is correct ? What is the problem with second method ?