Author Topic: Questions about 'customerAdd' 'customerMod'  (Read 1074 times)

tcpms

  • Member
  • *
  • Posts: 25
Questions about 'customerAdd' 'customerMod'
« on: March 21, 2015, 01:35:32 PM »
Just purchased/started to use FM Books Connector. First test was to add a customer. Went fine.
Then wanted to test updating info for that customer. Used the same 'addFieldWithValue' statements, only changed the request from 'Add' to 'Mod'.

I get the error:

CODE: -1000
SEVERITY: failed validation
MESSAGE: Error at FirstName
Reason:   Element 'FirstName' is unexpected according to content model of parent element 'CustomerMod'.
Expecting: ListID.

Since it recognized that I couldn't 'Add' the name a 2nd time, I thought that was sufficient to identify the record to be updated. Apparently not.

Is the ListID needed for the 'Mod'?  Do I need to pull the ListId back from QB after the original 'Add' so I can update the record at a later date? Or what?


Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Questions about 'customerAdd' 'customerMod'
« Reply #1 on: March 22, 2015, 05:21:51 AM »
You need either ( the ListID or the FullName )value and the current value of the Edit Sequence to modify a Customer record in QB. I recommend storing the ListID, since it's immutable, whereas the FullName value is user accessible and may be changed by a QB user. The Edit Sequence is returned with an Add or Mod Request, but if a user changes the record in QB, the EditSequence value changes. I recommend running a CustomerQueryRq to get the current value any time you need to make a Mod Request.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852