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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Link Between "Tenant Media Set" Table and the "Picture" field in Item

(4) ShareShare
ReportReport
Posted on by 89

Hi everyone,

I'm trying to display the item picture in a List part ("Lines Subform"). The Picture field on the item record has a direct link to the "Tenant Media Set" table. However, I'm unable to get the image to display properly in the list.

Interestingly, images from the "Tenant Media" table can be displayed in a list, but I can’t find a direct relationship between the item "Picture" field and the "Tenant Media" table.

So far:

  • "Tenant Media Set" is linked directly to the item's Picture field, but images don’t render in a List part.

  • "Tenant Media" images do render, but there seems to be no direct reference from the item record (I can't find one)

I know I can use the factbox to show the Picture, but that's not our requirement.

Has anyone managed to display item images in a List using the Picture field? Or found a way to map the "Tenant Media Set" entry to "Tenant Media"?

Any insight, workaround, or guidance would be greatly appreciated.

Thanks in advance!

I have the same question (0)
  • Suggested answer
    Sumit Singh Profile Picture
    10,079 on at
    Why It Doesn’t Work in List Parts
    • MediaSet fields are not supported for rendering images directly in List parts due to UI limitations.
    • FactBoxes support image rendering because they can handle media controls differently.

    Workaround Strategy
    To display item images in a List part, you need to extract the first media entry from the MediaSet and link it to a field that can be rendered. Here's how:
    1. Create a FlowField or Calculated Field
    Create a new field on your list source (e.g., Item Line) that references the first media entry from the Tenant Media Set.
    field("Item Picture"; MediaId)
    {
        Caption = 'Item Picture';
        DataClassification = ToBeClassified;
        Editable = false;
        ApplicationArea = All;
        DrillDown = false;
    }
    2. Use a Codeunit or Helper Function
    Write a function that extracts the first Tenant Media entry from the MediaSet and returns its ID.
    procedure GetFirstMediaId(ItemNo: Code[20]): Guid
    var
        ItemRec: Record Item;
        MediaSetRec: Record "Tenant Media Set";
        MediaRec: Record "Tenant Media";
    begin
        ItemRec.Get(ItemNo);
        if ItemRec.Picture.Count > 0 then begin
            MediaSetRec.Get(ItemRec.Picture.Item(1));
            exit(MediaSetRec."Media ID");
        end;
        exit(Guid::Empty);
    end;
    3. Bind the Media ID to a Media Field
    Use the returned Media ID in a field that can be rendered in the list.

    Alternative: Use a Custom Table
    If you have control over the data model, consider creating a custom table that stores a direct reference to the Tenant Media entry for each item. This simplifies rendering and avoids MediaSet limitations.

    Note: This response was created in collaboration with Microsoft Copilot to ensure clarity and completeness. I hope it helps to some extent.
    Mark the Answer as Verified if this is Helpful.
     
  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at
     

    Hi Jinesh,

    You're absolutely right — the Picture field on the Item record links to the Tenant Media Set table, which in turn references entries in the Tenant Media table. However, rendering images directly in a List part is limited due to how media sets are handled.

    Here's how you can approach this:

    1. Understand the Relationship:

      • The Picture field stores a reference to a Tenant Media Set.
      • Each Tenant Media Set can contain one or more Tenant Media entries.
      • Unfortunately, the Picture field does not directly expose the media content for rendering in a list.
    2. Workaround for List Rendering:

      • To display images in a List part, you need to reference the Tenant Media table directly.
      • You can create a custom field or calculated field that extracts the first media entry from the related media set and exposes it for rendering.
    3. Use Media Field in List Page:

      • In your custom List part, define a Media field and bind it to the extracted Tenant Media record.
      • Example:
    field(ItemImage; TenantMedia."Content")
    {
        ApplicationArea = All;
        MediaType = Image;
    }
     
    1. Custom Codeunit or Helper Function:

      • You may need a helper function to resolve the Tenant Media Set ID to the corresponding Tenant Media ID and return the image.
    2. Limitations:

      • Rendering images in a list can impact performance, especially with large datasets.
      • Consider lazy loading or limiting the number of images shown.

    Let me know if you'd like help writing the AL code to extract and display the image!

    Please verify if this response was helpful.

    Best regards!

  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at
    Hi, hope the following helps.
    Dynamics 365 Business Central: How to add Media or MediaSet data type (Pictures) to a report
    Dynamics 365 Business Central: How to show/display picture thumbnails on the list page
     
    Thanks.
    ZHU
  • Suggested answer
    Sahib Dino Profile Picture
    196 on at
      • The Picture field on the Item table is of type MediaSet, which links to the Tenant Media Set table.
      • Each Tenant Media Set entry can reference one or more Tenant Media records (actual media blobs).
      • However, MediaSet fields don’t render images directly in List parts due to UI limitations.


      •  
       

       


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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans