I need to create a SOAP web service codeunit that gets an item number and returns the picture that is on that item in Business Central cloud.
(I think there can be more that one picture, but I only want to get the first picture.)
I have made the procedure below on a codeunit, but it doesn't return anything.
What am I doing wrong?
procedure GetItemImage(itemNo: Code) Result: Text
Item: Record Item;
TenantMedia: Record "Tenant Media";
TempBlob: Codeunit "Temp Blob";
if Item.Get(itemNo) then begin
if Item.Picture.Count = 0 then begin
if TenantMedia.Content.HasValue then begin
Result := '';