web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Can Notes from Sales Orders be referenced using SQL?

(1) ShareShare
ReportReport
Posted on by 7

I have an SSRS report for NAV 2016; I'd like to add any Notes content to records that have them. Is there a way to find the record ID of the sales orders & link to the note (Record Links) using only SQL, without adding an assembly or a table column to the existing DB?

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    98,416 Super User 2026 Season 1 on at

    Hi, unfortunately, this cannot be done as far as I know. They are related by Record ID, but this value cannot be read directly from SQL.

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods/devenv-recordid-method-record

    pastedimage1684797617808v2.png

    pastedimage1684797781047v3.png

    Hopefully other experts can give you better advice.

    Thanks

    ZHU

  • John.B@AMETEK Profile Picture
    7 on at

    Hi Zhu. Thank you for taking the time answer - I appreciate it. I think I can perform a workaround: the Record Link "Description" field can be filtered on "Sales Order - " - I can then pull out the sales orders from that. The RecordID field precedes note-specific entries with '24000000' (if I convert the RecordID to Varchar first). I can convert & decompress the Note field ~mostly~ cleanly using this:

      CONVERT(

          varchar(max)

          , DECOMPRESS(

              CONVERT(varbinary(max), 0x1F8B0800000000000400)

              +

              CONVERT(varbinary(max), SUBSTRING([Note],5,8000))

            )

        )

    That gives me what I need for this user; if I need to pull more information from the Sales Order, I can use the Sales Order # pulled from the Description field.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans