Announcements
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.
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;
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.
Hi, hope the link below can give you some inspiration.
Thanks.
ZHU
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.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156