Actian GUID fields and Entity References

SOLVED

Hello,

I've written two programs that work together to generate real time reports out of Sage 50c.  One program uses the SDK to create, update and delete data in Sage while the other uses ODBC to make sure the report data stays up to date.  It's working well but I've had to use some workarounds. 

The SDK has to look up items by values such as "ReferenceNumber" or "ItemID" while the ODBC client uses database id values like "VendorRecordNumber" or "PostOrder".  I would like to use the same unique identifying property in both programs.

After toying around with entity references in the SDK and the GUID fields stored in Actian I noticed that they are identical except that apparently the Endianness of the first three sections is reversed, for example:

EntityReference: 7a7a6d2e-cef3-4de2-aad3-de19643aecd4
corresponds with GUID: 2E6D7A7A-F3CE-E24D-AAD3-DE19643AECD4

So I've actually got 2 questions:

  1. If I reverse the byte order of the first 3 sections of the GUID can I do something like: Sage.Peachtree.API.EntityReference.Create<Sage.Peachtree.API.PurchaseOrder>(new Guid("7a7a6d2e-cef3-4de2-aad3-de19643aecd4")).Load(CompanyRef)
  2. Can the Sage SDK do that work for me another way?