Hello
I am writing to the NAV Record Link table via a SQL Query and I can get this to work on NAV2009 but not in NAV2015.
The problem I have is with the RecordID field. The encoding seems to have changed between the two NAV versions.
I am entering a link for the Purchase Header Table for the Document Type of Order.
The Query I am using below worked for 2009, but not for 2015.
Select @RECORDID = 0x26000000008B01000000027BFF+CONVERT(VARBINARY(448),@CHVPONUMBER)
Up until the characters BFF that is not a problem as this is the table number and the keys, this part of the binary value can be hardcoded in the query as it will not change.
The problem is the Convert of the PO number to Varbinary.
In NAV2009, the PO Number would translate to this using the Query Below, and this works
0x26000000008B01000000027BFF505246303030303033
However for NAV2015, if I manually create the Record Link in NAV, the same PO Number is converted to
0x26000000008B01000000027BFF50005200460030003000300030003000330000000000
How can I convert this in SQL please? There are additional bytes in between and at the end and I don't know what they mean!
Thank you
Ruth
*This post is locked for comments