Productive Computing, Inc. Support Forum

Plug-ins => FM Books Connector => Topic started by: WillzShire on June 06, 2014, 11:21:00 AM

Title: Is OSR tripping me up???
Post by: WillzShire on June 06, 2014, 11:21:00 AM
QuickBooks SDK
FileMaker Pro 12 Advanced
QuickBooks Pro 2014
Max SDK Version 13.0
qbXML (selected)

Keep having trouble with element order for Push Customer to QB


CODE: -1000
SEVERITY: failed validation
MESSAGE: Error at State
Reason:   Element 'State' is unexpected according to content model of parent element 'BillAddress'.
Expecting: Country, Note.

Field Value:   

PCQB_RqNew( "CustomerAdd" ) &
PCQB_RqAddFieldWithValue("Name" ; Contacts_::Contact Company Name ) &
PCQB_RqAddFieldWithValue("CompanyName" ; Contacts_::Contact Company Name ) &
PCQB_RqAddFieldWithValue("Salutation" ; Contacts_::Title ) &
PCQB_RqAddFieldWithValue("FirstName" ; Contacts_::FirstName ) &
PCQB_RqAddFieldWithValue("MiddleName" ; Contacts_::MiddleName ) &
PCQB_RqAddFieldWithValue("LastName" ; Contacts_::LastName ) &
PCQB_RqAddFieldWithValue("BillAddress::Addr1" ; Contacts_::Contact Address ) &
PCQB_RqAddFieldWithValue("BillAddress::Addr2" ; Contacts_::Contact Address ) & 
PCQB_RqAddFieldWithValue("BillAddress::City" ; Contacts_::Contact City ) &
PCQB_RqAddFieldWithValue("BillAddress::State" ; Contacts_::Contact State ) &
PCQB_RqAddFieldWithValue("BillAddress::PostalCode" ; Contacts_::Contact Zip ) &
PCQB_RqAddFieldWithValue("ShipToAddress::Name" ; Contacts_::Contact Company Name ) &
PCQB_RqAddFieldWithValue("ShipToAddress::Phone" ; Contacts_::Contact Phone ) &
PCQB_RqAddFieldWithValue("ShipToAddress::Emaill" ; Contacts_::Contact Email ) &
PCQB_RqAddFieldWithValue("AdditionalContactRef::ContactName" ; Contacts_::Contact Person ) &
PCQB_RqAddFieldWithValue("AdditionalContactRef::ContactValue" ; Contacts_::Contact Person ) &
PCQB_RqAddFieldWithValue("AdditionalNotes::Note" ; Contacts_::Contact Person )


Please Advise
Thank You
WillzShire
Title: Re: Is OSR tripping me up???
Post by: Jerel Malong on June 06, 2014, 12:41:53 PM
Are you using the US edition of QuickBooks?
Title: Re: Is OSR tripping me up???
Post by: Geoffrey Gerhard on June 06, 2014, 01:19:18 PM
Jerel:

Which versions do NOT use State?

Will:

I've posted this elsewhere, but will reiterate that evaluating the PCQB_SGetXML( "Request" ; "" ) function after you see the error usually provides enough detail to identify the problem.

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852
Title: Re: Is OSR tripping me up???
Post by: Chris Turner on June 06, 2014, 01:26:26 PM
The OSR does not have a differentiation for "BillAddress::State" between international versions of QuickBooks, even though those regions are not necessarily called "State" in the UK or Canada ("Provinces", I think, is the right term). I think that since we use "Province" in the other version of our demo files, that's where the thought came up.

I agree with Geoffrey's suggestion. After performing PCQB_RqExecute for the CustomerAdd request, please evaluate "PCQB_SGetXML( "Request" )" and post the results here. That should assist in figuring out what is amiss in the request that is causing the validation error.
Title: Re: Is OSR tripping me up???
Post by: WillzShire on June 06, 2014, 01:58:24 PM
QuickBooks is US version

Changed State to Province but same result - does not like Province now.

Geoffrey,
evaluating the PCQB_SGetXML( "Request" ; "" ) function
not sure? do I put this function in the script after last error check?
Title: Re: Is OSR tripping me up???
Post by: Chris Turner on June 06, 2014, 02:26:03 PM
In your script, you can set a variable or a field after calling PCQB_RqExecute. Like so:

Code: [Select]
# Build your request...
#
# Execute:
Set Variable [$result; Value:PCQB_RqExecute]
# Get Request XML:
Set Variable [$$RequestXML; Value:PCQB_SGetXML( "Request" )]
#
# Error handling...
#

The results of that $$RequestXML variable, or the value of the field if you use Set Field instead, will have the XML that will help get to the root of the issue.