Knowledgebase: Tutorials
[QODBC-Desktop] How to insert SalesOrderLine item to an existing SalesOrder
Posted by Jack - QODBC Support on 09 November 2016 12:42 PM

How to insert a SalesOrderLine item into an existing SalesOrder

Problem Description:

I routinely create new sales orders with queries similar to this:

INSERT INTO SalesOrderLine ("CustomerRefListID," "RefNumber," "SalesOrderLineItemRefListID," "SalesOrderLineDesc," "SalesOrderLineQuantity," "SalesOrderLineRate," "SalesOrderLineAmount," "FQSaveToCache")
VALUES ('CustomerRefListID,' 'RefNumber,' '80000095-1351453721', 'spark generator,' 50, 2.39, 119.5, [0 for the last line, 1 for other lines])

Can I insert a new line into an EXISTING sales order with a similar query?

If so, what value do I use for FQSaveToCache?

Solution:

You need to add 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 SalesOrder, please remove header information fields like "CustomerRefListID" and "RefNumber" from your query.

Here is an example of adding one line item to an existing SalesOrder "4912-1071512816" in our test company file:

INSERT INTO SalesOrderLine (TxnID, SalesOrderLineItemRefListID, SalesOrderLineDesc, SalesOrderLineQuantity, SalesOrderLineRate, SalesOrderLineAmount) VALUES ('4912-1071512816', '160000-933272656', '4m Steel Ladder', 1.00000, 1.00000, 150.00)

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.

Note: The FQSaveToCache does support existing SalesOrder queries.

(1 vote(s))
Helpful
Not helpful

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