-->

Relating Entires from QBSDK to IPP?

2019-02-25 08:42发布

问题:

We're currently using the Windows QBSDK to interact with QuickBooks. We're evaluating IPP going forward. However, the QBSDK uses ListID's / TransactionID's to identify objects and IPP uses a different scheme. Is there a way to determine the mapping between the two?

回答1:

Asked the same question at IDN and was told there is not away to perform this translation. However, a little bit of assistance from a partner, some careful watching of results between IPP and QuickBooks and I have a fairly decent answer.

A typical ID in QuickBooks looks like this:

80000001-1296949588

The first portion is the identifier and the second portion is some form of timestamp.

Treat the first portion as a 32-bit hexadecimal number and turn off the high bit. In this case, you will get 1.

If you create the record first in QB then sync to IPP, you will find a record identified in this manner:

<Id idDomain="QB">1</Id>

If you create the record first in IPP, you will find a record identified in this manner:

<Id idDomain="NG">1</Id>

Once you sync, you will find an external record reference for example:

<ExternalKey idDomain="QB">3</ExternalKey>

This would match to a transaction id in QuickBooks:

80000003-1299163737

Unfortunately, this transform is not isomorphic because of the time stamp appended at the end of the identifier in QuickBooks. Therefore, translating from a QuickBooks ID to a IPP based ID is trivial to perform. Translating the other way will require an enumeration of records in QuickBooks and matching up of the ID's.