[QODBC-Desktop] How to insert InvoiceLine item to an existing Invoice
Posted by Rajendra Dewani (QODBC Support) on 14 April 2014 03:28 PM
How to insert InvoiceLine item into an existing Invoice.
I am trying to run an INSERT statement that I have run before on version 10, but am now getting the following error.
SQL Statement: INSERT INTO InvoiceLine (TxnID,RefNumber,InvoiceLineItemRefListID,InvoiceLineDesc) VALUES ('56989-1362006634','6529','80000271-1266353613','Shipped On: 28/55/2013 USPS Tracking#: LC123456789012345678US')
You have added field TxnID into the insert query. The field “TxnID” is available in insert query only when the TxnID value points to an existing entity in QuickBooks.
If you want to add line item record into existing invoice, then please remove header information fields like “RefNumber” from your query.
Header information fields (CustomerRefListID, RefNumber, ShipAddress, ClassRefListID and so on) cannot be added into the query when you try to add line record to existing entity. This will cause an XML error.
Here is an example of adding one line item to an existing invoice “18E8A-1481798951” in our test company file:
INSERT INTO InvoiceLine (TxnID, InvoiceLineItemRefFullname, InvoiceLineDesc, InvoiceLineRate, InvoiceLineAmount) VALUES ('18E8A-1481798951','test item 2', '11440DECA', 0.01,0.01)
Please notice that all values in the query come from our test company file, please replace them using your value when running it on your end. And you can also add other line item columns into this query according to your request.