Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
Create new Sales Order |
Author |
Message |
|
Posted : 2007-02-05 22:44:42 |
Hi, I am using QuickBooks Premier version 2005 and QODBC version 7.00.00.204. I wish to add a Sales order in QB using VB 6.0 that consist of multiple line items. The issue is that my existing code creates a new order for every line item. Does anyone have a sample code that will show how to add a sales order containing multple line items in QB. Any help in this regard would be really helpful. Thanks in advance.
Regards, Clifford |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-02-06 09:49:41 |
|
|
|
|
Posted : 2007-02-12 21:59:11 |
Hi Tom,
Thanks for your suggestion,. It worked fine. Now is there a way where I can get the Order Number for the order I have just added. Please remember there can be multiple users creating orders at a time so the Max() option is out.
Regards, Clifford
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-02-12 23:56:50 |
Sure, the SP_LASTINSERTID SalesOrderLine stored procedure will give you the TxnID for the Sales Order you just created (inserted). So just use it at the end of your loop to find the TxnID so you can query the Sales Order table for the other details like this:
select RefNumber from SalesOrder where TxnID='5BCE-1197765797' |
|
|
|
|
Posted : 2008-07-01 09:31:39 |
How does it work with locking? Conflicting users?
If I run SP_LASTINSERTID SalesOrderLine , could there ever be a situation that when this procedure runs, it picks up a transaction entered by another user, say a user that is running the QB software and entering a SO manually, on the same network?
What about if multiple users are using a web based app that is connected to QB via QODBC. Do we need to handle that in our web app, or is that built in..
my hunch is no, just making sure :) |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-07-01 11:22:01 |
SP_LASTINSERTID is only revalent to the current QODBC connection thread. It can't see what other QuickBooks users are doing. QODBC also does not do any locking as it actually talks to QuickBooks, not the datafile. QuickBooks handles datafile operations and as we all know it's not multi-user, so you will receive an error message if you try to add a sales order to a customer that another user is currently using. |
|
|
|
|