Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

SQL query to join Item table and Record Link

Posted on by 1,299

Hi Experts,

I am new to NAv and i am trying to pull out a report from NAV DB joining the Items table and the record link table, but seems that the Record Link ID in the Record Link table is just a bunch of numbers and basically now i dont know on which column should i be joining these two table, please help me here. I just need a sql query.

Thanks in advance for your help.

  • Davyjones Profile Picture
    Davyjones 1,299 on at
    RE: SQL query to join Item table and Record Link

    This seems to be a good solution, but i dont think we can do this. I am still looking for a sql query to do it and i think there should be some way.

  • Suggested answer
    Robert B. Profile Picture
    Robert B. 257 on at
    RE: SQL query to join Item table and Record Link

    Hi Davyjones,

      You can use a new field of type recordID to store the value.

       I pasted that snippet I wrote at the time with a variable, but it can be easily a new field created like this:

    pastedimage1573586066503v1.png

    Cheers,

    Robert

    Please verify my answer, if you find it useful, that way others can find this solution easier!

  • Davyjones Profile Picture
    Davyjones 1,299 on at
    RE: SQL query to join Item table and Record Link

    Hi Robert,

    Thanks for your response, I am kind of new to NAV, so basically you are suggesting that we create a new field and then update each repord in the item table for corresponding records type, is that right?  Can you please let me know or share link on how to create a RecordID field type in the item table.

    Thanks in advance for your response.

  • Verified answer
    Robert B. Profile Picture
    Robert B. 257 on at
    RE: SQL query to join Item table and Record Link

    Hi Davyjones,

     You mentioned joining in SQL, so if you really need to do things in SQL, ask a Microsoft Partner to create a RecordID field type in the item table and update it with the associated value of the Item record with a processing only report.

      Let me know if you need help with that.

     Also on insert event of the item table this field needs to be populated. you can use these functions, just that I update a variable there instead of a new field.

    pastedimage1572464979955v1.png

      That will give you the relation you need for SQL joins. 

    Cheers,

    Robert

    Please verify my answer, if you find it useful, that way others can find this solution easier!

  • Davyjones Profile Picture
    Davyjones 1,299 on at
    RE: SQL query to join Item table and Record Link

    Is there no solution to this in SQL?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans