QuickBooks entities on a remote system get out of sync with QuickBooks Desktop when you merge two entities. I believe this happens with any mergeable entity, but I'll use customer as an example:
A customer is created in QuickBooks, and the remote system receives the customer in the query response:
QB remote system ------------ ------------- C1 ACME, Inc C1 ACME, Inc
Somebody then adds a similar ('duplicate') customer. The remote system receives the 2nd customer in the query response:
QB remote system ------------- ------------- C1 ACME, Inc C1 ACME, Inc C2 ACME Inc. C2 ACME Inc.
Somebody merges customer 1 into customer 2 in QuickBooks.
QB remote system ----------------- ------------- C1 MERGED INTO C2 C1 ACME, Inc C2 ACME Inc. C2 ACME Inc.
At least 3 things don't happen in QuickBooks and the Web Connector that probably should (not necessarily in order of importance):
- C2's modified date is not changed (I'm not 100% sure about this but believe it to be true)
- There is no knowledge that the 'source' customer, C1, was just merged into the 'target' customer, C2.
- Not least, C1 is not included in ListDeletedQueryRs even though it is gone forever (sounds like very much like a delete when it was available a moment ago before the merge and now it's gone forever).
Now the remote system is not in sync and and CAN'T EVER be in sync with QuickBooks without querying for the FULL customer list to detect that the customer that was merged 'away' has been effectively deleted. If I want them to get back in sync, on the remote system, after re-querying for the full customer list (99.99% of which I don't need because I already have them in their up-to-date entirety), I now have to loop through every single remote customer and track which ones don't have a match in the full customer list that I [unnecessarily] had to query for.
Also I have no way of knowing that the two customers are combined, so related data, such as invoices created on the remote system, can't be moved from the merged-away customer, C1, to the customer that remains, C2.
I'm hoping I'm wrong about the above and that I'm missing something obvious or creative that will prevent the need to requery for all customers to get the remote system back in sync, and also allow me to know to transfer related data to the customer that remains.
One thought I've had as I've been writing this is that I could, for example, when I'm about to sync invoices for C1, I could first query for C1 by ListID. This could tell me that the customer is gone and to not try to sync the invoices. So I can flag that customer as "probably merged", but I still lack critical information about where the customer was merged to. Without that, the invoices on the remote system are unnecessary orphans!