Quickbooks how to create customer then create customer job

Brerproospeta

New Member
So we have code which creates a customer, and then a customer Job. The customer job fails for inexplicable reasons.Here is the initial request:\[code\]<?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>\[/code\]And the relevant portion of the response:\[code\]<?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> \[/code\]We go back to Quickbooks with this:\[code\]<?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> \[/code\]And Quickbooks then responds to that second request with this:\[code\]<?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> \[/code\]The first response is at 2013-01-21 10:34:22.353 and the second at 2013-01-21 10:35:21.080 (server time).Why is it failing? Note that it often works. In this request sequence alone it created two others without issues using the same commands.Sometimes for good measure it responds with this instead:\[code\]<?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> \[/code\]How do you ensure that a customer just created is in the list to reference in the next command?
 
Back
Top