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 : Clearing the cache.... againSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Clearing the cache.... again 
 Author   Message 
  Mark 
  
 Group: Members 
 Posts: 4 
 Joined: 2007-10-04 
 Profile
 Posted : 2008-10-16 00:25:38
Hi,

I'm using access to write batch invoices to QB2006 UK. I am using multiple invoice lines (i.e. multiple invoiceline inserts followed by a header invoice insert) and so if anything goes wrong there is a chance that cached invoice lines will be added to the next invoice. I have read in this forum that there is no way to explicitly clear the cache but that it can be achieved if I close the connection or try and access another table. I cannot close the connection in this case so what sort of command can I run to clear the cache? Will the following work and does it have any side effects?

INSERT INTO "InvoiceLine" ("InvoiceLineDesc", "FQSaveToCache") VALUES ('', 0)

Could I run this before each invoice is submitted to ensure the cache is cleared?

Thanks,
Mark Urban
 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-16 08:27:14

Running:

INSERT INTO "InvoiceLine" ("InvoiceLineDesc", "FQSaveToCache") VALUES ('', 0)

without previous InvoiceLine inserts will cause an error. The better approach is to just do InvoiceLine inserts without the Invoice (header) insert. Nearly all the columns can be accessed through InvoiceLine.

 

 

  Top 
  Mark 
  
 Group: Members 
 Posts: 4 
 Joined: 2007-10-04 
 Profile
 Posted : 2008-10-22 20:07:34
Surely this will not solve the problem. For example assume I insert 2 invoices, each with 3 inserts to InvoiceLine, and an error occurs before the final line of the first invoice (where FQSaveToCache is set to 0) - the successful lines of the first invoice will appear in the second. Or am I missing something?

Thanks for your help,
Mark
JamJar Print 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-23 07:39:15
Yes, it will. When just inserting mulitple INSERT INVOICELINE statements, should there be an error, then the whole invoice fails and it isn't written into QuickBooks. 

  Top 
  Mark 
  
 Group: Members 
 Posts: 4 
 Joined: 2007-10-04 
 Profile
 Posted : 2008-10-24 03:21:58
Sorry but I'm having trouble understanding this - I'm probably just being dense:

Assume two invoices with 3 lines each and an error occuring on the second:

BEFORE:

1)Insert Into InvoiceLine.... (FQ=1)
2)Insert Into InvoiceLine.... (FQ=1)     <---Error
3)Insert Into Invoice....                          <-Skipped

4)Insert Into InvoiceLine....(FQ=1)
5)Insert Into InvoiceLine....(FQ=1)
6)Insert Into Invoice....                           <--4 lines inserted (1,4,5,6)

YOUR WAY:

1)Insert Into InvoiceLine....(FQ=1)
2)Insert Into InvoiceLine....(FQ=1)         <---Error
3)Insert Into InvoiceLine....(FQ=0)         <-Skipped

4)Insert Into InvoiceLine....(FQ=1)
5)Insert Into InvoiceLine....(FQ=1)
6)Insert Into InvoiceLine....(FQ=0)        <-Only 3 lines inserted??? (4,5,6)

How does line 6 know to skip the InvoiceLine 1? It doesn't know whether line 3 is Invoice or InvoiceLine as it has been skipped, so how can it make a difference?
Sorry to be so argumentative, I just really want to understand how and why it would work.

Thank you for all your help
Mark 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-24 07:54:22
When FQSaveToCache is used to insert multiple lines, all the lines are cached in QODBC and then ONE XML REQUEST is sent to QuickBooks to add the invoice. So if there's an error when just inserting invoicelines, then no XML REQUEST is processed by QuickBooks. 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to