Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Suggested answer

Get links on items on a web service

Posted on by 543

Hi experts,

This is regarding Business Central cloud.

On an item, you can make several links to files on some public server.

I would like to make these records available for a web service. How do I do that?

I can see that this has something to do with the table "Record Link" (number 2000000068). But I need to show the item number, description and the link to the file.

Hope, someone can help.

  • Morten Steengaard Profile Picture
    Morten Steengaard 543 on at
    RE: Get links on items on a web service

    Problem solved.

    On the table "Record Link" there is a field called URL1. That contains the URL. I simply missed that.

    Furthermore there is a field called "Record ID". I use that to get the Item-record like this where Rec is the "Record Link" table:

       trigger OnAfterGetRecord()

       var

           RecordRef: RecordRef;

           MyFieldRef: FieldRef;

       begin

           if Rec.Type = Rec.Type::Link then begin

               RecordRef.Open(Database::Item);

               if RecordRef.Get(Rec."Record ID") then begin

                   MyFieldRef := RecordRef.Field(1);   // 1 = "No."

                   ItemNumber := MyFieldRef.Value;

               end;

           end;

  • Morten Steengaard Profile Picture
    Morten Steengaard 543 on at
    RE: Get links on items on a web service

    Thank you very much NorthW and YUN ZHU for your reply.

    I still need to understand the table relations.

    On one of my items, I have made two links to files on another server.

    I have an Item record (no. 27). And I can see two records in the table "Record Link" (no. 2000000068).

    But what is the link between table "Item" and table "Record Link"?

    And when I have the "Record Link" record, how do I find the link (eg. "www.myServer.com\theFile.pdf")?

    Hope you can help.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 70,099 Super User 2024 Season 2 on at
    RE: Get links on items on a web service

    Hi, hope the link below can give you some inspiration.

       

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,744 Moderator on at
    RE: Get links on items on a web service

    There is no standard API that gives you this information. So the best approach is to use a custom API for this:

    docs.microsoft.com/.../devenv-develop-custom-api

    Then you can make a API that you use the Item No. as a input and return the Item no. description and links.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans