So, we have the code that creates the client, and then the client work. Client work does not work for inexplicable reasons.
Here is the original request:
<?xml version="1.0" encoding="US-ASCII"?><?qbxml version="8.0"?> <QBXML> <QBXMLMsgsRq newMessageSetID="c80f653c176ed1e5975e" onError="stopOnError"> <CustomerAddRq> <CustomerAdd> <Name>xxxx. (20615)</Name> <CompanyName>xxxx</CompanyName> <Salutation/> <FirstName/> <MiddleName/> <LastName/> <BillAddress> <Addr1>xxxx</Addr1> <Addr2>xxx</Addr2> <Addr3/> <Addr4/> <City>xxx</City> <State>xx</State> <PostalCode>xxxxx</PostalCode> <Country>USA</Country> <Note/> </BillAddress> <Phone>000000</Phone> <Fax>000000</Fax> <Email/> <Contact/> <TermsRef> <FullName>Net 30</FullName> </TermsRef> </CustomerAdd> </CustomerAddRq> </QBXMLMsgsRq> </QBXML>
And the corresponding part of the answer:
<?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs newMessageSetID="3368552138367687637"> <CustomerAddRs statusCode="0" statusSeverity="Info" statusMessage="Status OK"> <CustomerRet> <ListID>80000118-1272906278</ListID> <TimeCreated>2010-05-03T13:04:38-05:00</TimeCreated> <TimeModified>2010-05-03T13:04:38-05:00</TimeModified> <EditSequence>1272906278</EditSequence> <TermsRef> <ListID>80000006-1244039697</ListID> <FullName>Net 30</FullName> </TermsRef> <Balance>0.00</Balance> <TotalBalance>0.00</TotalBalance> <JobStatus>None</JobStatus> </CustomerRet> </CustomerAddRs> </QBXMLMsgsRs> </QBXML>
We come back to Quickbooks with this:
<?xml version="1.0" encoding="US-ASCII"?><?qbxml version="8.0"?> <QBXML> <QBXMLMsgsRq newMessageSetID="0da30b5086cd3938febe" onError="stopOnError"> <CustomerAddRq> <CustomerAdd> <Name>xxxxxxx</Name> <ParentRef> <ListID>80000118-1272906278</ListID> </ParentRef> <CompanyName>xxxxxxx</CompanyName> <Salutation/> <FirstName/> <MiddleName/> <LastName/> <BillAddress> <Addr1>xxxxx</Addr1> <Addr2>xxxxx</Addr2> <Addr3/> <Addr4/> <City>xxxx</City> <State>xxx</State> <PostalCode>xxxx</PostalCode> <Country>USA</Country> <Note/> </BillAddress> <Phone>00000000</Phone> <Fax>0000000</Fax> <Email/> <Contact/> <TermsRef> <FullName>Net 30</FullName> </TermsRef> </CustomerAdd> </CustomerAddRq> </QBXMLMsgsRq> </QBXML>
And Quickbooks then answers this second request as follows:
<?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs newMessageSetID="0da30b5086cd3938febe"> <CustomerAddRs statusCode="3240" statusSeverity="Error" statusMessage="Object "80000118-1272906278" specified in the request cannot be found. "/> </QBXMLMsgsRs> </QBXML>
The first answer is on 2013-01-21 10: 34: 22.353, and the second is on 2013-01-21 10: 35: 21.080 (server time).
Why does he fail? Please note that this often works. In this sequence of queries, he created two others without problems using the same commands.
Sometimes, for good measure, he answers instead:
<?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs newMessageSetID="215932fd6e1fffdd574c"> <CustomerAddRs statusCode="3120" statusSeverity="Error" statusMessage="Object "11A0001-1289401726" specified in the request cannot be found. QuickBooks error message: Invalid argument. The specified record does not exist in the list."/> </QBXMLMsgsRs> </QBXML>
How do you guarantee that the client you just created is listed for the link in the next command?