The first step is to actually check that there are orphaned InvoiceLines. I would hazard to guess that you have orphaned optimized InvoiceLines only and no real orphaned InvoiceLines in QuickBooks. Run the following query with the unoptimized tag using VB Demo:-
SELECT TxnID, InvoiceLineTxnLineID, InvoiceLineDesc, InvoiceLineAmount, RefNumber FROM InvoiceLine unoptimized where RefNumber = 'yourrefnumber'
where 'yourrefnumber' is the Reference for the Invoice.
If no InvoiceLines are returned you can resync your optimized InvoiceLine table by running:
sp_optimizefullsync InvoiceLine
|