Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

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

Forum : Update Existing Estimate and adding new lines to a existing EstimateSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v8 Forum

 New Topic 
 
 Post Reply 
[1]  
 Update Existing Estimate and adding new lines to a existing Estimate 
 Author   Message 
  michael 
  
 Group: Members 
 Posts: 10 
 Joined: 2008-04-17 
 Profile
 Posted : 2008-04-17 12:27:07

Is there a way to update an existing estimate using the latest qodbc driver?  I have successfully created an estimate, but I have situations where I need to update an existing one.

Thanks...

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-04-17 12:37:05

Updates to existing Estimate lines are done using the transaction ID and the line ID as the estimate reference like this:

UPDATE EstimateLine SET EstimateLineDesc = 'New description'
WHERE TxnID = '3D35E-1153180652' AND EstimateLineTxnLineID = '3D36B-1153180652'

See also: How do I convert an Estimate to a Sales Order? 

 

  Top 
  michael 
  
 Group: Members 
 Posts: 10 
 Joined: 2008-04-17 
 Profile
 Posted : 2008-04-18 23:31:33

Tom,  thanks.  But, I don't think I was clear.  I need to add another estimate line to an existing estimate.  Is that possible?

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-04-21 08:00:34

To understand the process, I will do a simple one line estimate example and then add a new line.

FIRST TO CREATE THE ESTIMATE
The following SQL statement will create a new estimate:

INSERT INTO "EstimateLine" ("CustomerRefListID", "RefNumber", "EstimateLineItemRefListID",
"EstimateLineDesc", "EstimateLineRate", "EstimateLineAmount", "EstimateLineSalesTaxCodeRefListID",
"FQSaveToCache") VALUES ('470001-1071525403', '201', '250000-933272656',
'Building permit No 201', 100.00000, 100.00, '20000-999022286', 0)

Once the estimate is created, we can locate the TxnID using the QODBC stored procedure (as long as we haven't broken our QODBC connection) or by quering the Estimate table later on:

SP_LASTINSERTID EstimateLine

The TxnID for the new estimate is 5D0A-1197668108, so we can now add additional lines to the Estimate by using the TxnID and doing:

INSERT INTO "EstimateLine" ("TxnID", "EstimateLineItemRefListID",
"EstimateLineDesc", "EstimateLineRate", "EstimateLineAmount",
"EstimateLineSalesTaxCodeRefListID")
VALUES ('5D0A-1197668108', '250000-933272656',
'Building permit No 202', 200.00000, 200.00, '20000-999022286')

which results in the following estimate with two lines in the QuickBooks 2007 Premier USA Edition - Sample Rock Castle Construction company file:

 

  Top 
  michael 
  
 Group: Members 
 Posts: 10 
 Joined: 2008-04-17 
 Profile
 Posted : 2008-04-21 23:10:35

Tom, thanks.  For my scenario, I may create an estimate with 1 or more lines, save it... no problem, estimate created.  But, my troubles were, that days later, I may need to add an additional estimate line to that estimate I saved days before.

So your saying, as long as I get the correct TxnID, I can insert a new estimate line into an existing estimate?

Thanks for all your help so far...

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-04-22 07:33:08

Yes, you just need the TxnID which can be found by quering the Estimate table minutes, hours, weeks or months later by doing:

Select TxnID from Estimate where RefNumber='enterthenumberhere'

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to