Knowledgebase
[QODBC-Desktop] How to insert InvoiceLine item to an existing Invoice
Posted by Rajendra Dewani (QODBC Support) on 14 April 2014 03:28 PM

Problem Description:

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 I 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')
System.Data.Odbc.OdbcException: ERROR [00000] [QODBC] Error parsing complete XML return string. at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean need reader, Object[] method arguments, SQL_API odbcApiMethod) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) at System.Data.Odbc.OdbcCommand.ExecuteNonQuery()

Solution:

You have added the field TxnID into the insert query. The field "TxnID" is available in the insert query only when the TxnID value points to an existing entity in QuickBooks.

If you want to add a line item record to an 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 to the query when you try to add a line record to an 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 to this query according to your request.

(3 vote(s))
Helpful
Not helpful

Comments (2)
rizwan
05 June 2017 06:12 AM
Not working
INSERT INTO SalesOrderLine ( SalesOrderLineQuantity, SalesOrderLineItemRefFullName, TxnDate, TxnID ) VALUES ( 1, 'test drink', {d'2017-06-30'}, '11E-1496395352' )Could not execute: S0000: [QODBC] Field not allowed in insert.
Jack
05 June 2017 06:38 AM
Hi Rizwan,

If you want to insert SalesOrderLine item to an existing SalesOrder, then please refer below mentioned link for How to insert SalesOrderLine item to an existing SalesOrder:
http://support.flexquarters.com/esupport/index.php?/Knowledgebase/Article/View/2843/0/qodbc-desktop-how-to-insert-salesorderline-item-to-an-existing-salesorder

If you are still facing issue, I kindly request you to please raise a support ticket to the QODBC Technical Support department from below mentioned link & provide requested information:
http://support.flexquarters.com/esupport/index.php?/Tickets/Submit

We may need the following information, I kindly request you to attach below listed files when replying to the ticket.
1) Screenshot of QODBC Setup Screen -- > About
2) Screenshot of the issue you’re facing.
Share Entire Log Files as an attachment in text format from
3) QODBC Setup Screen -- > Messages -- > Review QODBC Messages
4) QODBC Setup Screen -- > Messages -- > Review SDK Messages

Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).