Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Get links on items on a web service

(0) ShareShare
ReportReport
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 74,036 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,748 Super User 2024 Season 1 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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans