How to know table and record for a "Record link" from SQL ?

GoyoGoyo Member Posts: 36
edited 2012-07-06 in NAV Three Tier
Hi everyone. I'm writing an application in .Net and selecting data from a SQL Nav 2009 database.

I'm trying to show the URL1 field from the table "Record Link" associated to a record from a table, but I don't know how to access to the correct "Record Link" record. When I open the Links in Navision I can see the column "Record ID" wich contains the Table and Key values, but in SQL the content for this column is some weird number.

I've been looking in mibuso for help but I haven't found how to make an SQL with this purpose.

Anyone knows the solution.

Thanks.

Answers

  • krikikriki Member, Moderator Posts: 9,112
    There isn't an easy one.
    I also had the problem and the only solution I found was to create in each record a Record ID that points to itself.
    That way, in SQL I can connect the "Record Link"-record to the original record. But you will need to add the "Table ID" of the table to which the record is connect to make it easy to find.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • davmac1davmac1 Member Posts: 1,283
    look at doing what I did - format the description so it can be used to find the correct link
  • GoyoGoyo Member Posts: 36
    Thank you all for your help, I'll try first the kriki solution, since it seems easier and I have to show only the links for one particular table. I'll let you know how it worked.

    Thanks.
  • GoyoGoyo Member Posts: 36
    Ok, it worked =D>

    I've created a field type RecordId and populate it OnInsert. For table "Production Order" it works fine, even when you change its state, the OnInsert is triggered again and it keeps working.

    Thank you so much.
Sign In or Register to comment.