Knowledgebase: Tutorials
[QODBC-Desktop] Troubleshooting - How do I delete orphaned InvoiceLine records?
Posted by Jack - QODBC Support on 09 March 2016 12:56 PM

Troubleshooting - How do I delete orphaned InvoiceLine records?

Problem Description:

The InvoiceLine table contains orphan records (the parent invoice record no longer exists). I tried:

DELETE FROM Invoice WHERE TxnID = 'xxxx-xxxxxxxxx'

The TxnID is supplied from a list before running the DELETE command.

However, no records are deleted. What am I doing wrong? 
 

Solution:

The first step is actually to check that there are orphaned InvoiceLine. I would hazard to guess that you have orphaned optimized InvoiceLine only and no real orphaned InvoiceLines in QuickBooks. Run the following query with the unoptimized tag using QODBC Test Tool:-

SELECT TxnID, InvoiceLineTxnLineID, InvoiceLineDesc, InvoiceLineAmount, RefNumber FROM InvoiceLine unoptimized where RefNumber = 'YourRefNumber.'

Where 'YourRefNumber' is the Reference to the Invoice.

If no InvoiceLine is returned, you can resync your optimized InvoiceLine table by running:

sp_optimizefullsync InvoiceLine

(0 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).