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 Other 1 Field and adding new lines to a existing EstimateSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Sample Scripts Forum

 New Topic 
 
 Post Reply 
[1]  
 Update Other 1 Field 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:31:01

Using the latest version of qodbc, is there a way to update the "Other 1" field of an estimate line?

Thanks...

 

 

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

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

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

 

 

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

Tom, Thanks.  But how about when your inserting a new record into EstimateLine?  Can a value be inserted at that point?

 

 

 

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

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 etimate 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:15:57

Tom, in your insert examples, I don't see where you are using the field "CustomFieldEstimateLineOther1".    Is that only  possible on the update statement?

 

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

The rules for any QODBC table and your version of QuickBooks can be found by running:

sp_columns tablename

and in my case, using QuickBooks 2007 Premier USA Edition:-

the CustomFieldEstimateLineOther1 is both insertable and updateable. So the column and value can be added to the insert statement.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to