Dynamics 365 Business Central: How to get HTML Image src attribute via AL (The Image Embed element)
The post explains how to extract HTML Image src attributes from images stored in Business Central items using the standard Image Helpers codeunit and GetHTMLImgSrc method. This technique allows developers to retrieve and display image data in HTML format within AL code.

post Dynamics 365 Lab
"The HTML Image src attribute of the image can be inserted after src to display it directly."
Key points
- Business Central provides a standard Image Helpers codeunit (4112) with a GetHTMLImgSrc procedure for obtaining HTML image src attributes
- Images stored as Tenant Media records can be retrieved and converted to HTML-compatible src attributes via AL code
- The WebPageViewer add-in can display images using HTML img tags with embedded src attributes
- Example code demonstrates extending the Item Card page to retrieve and display the HTML src attribute of item pictures
Quotes
- “The HTML Image src attribute of the image can be inserted after src to display it directly.” (Explains the fundamental purpose of the src attribute in HTML image tags for direct display)
- “There is a standard method for obtaining HTML Image src attribute directly in BC.” (Highlights that developers don’t need custom solutions as Business Central provides built-in functionality)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- codeunit 4112 “Image Helpers”
- table “Tenant Media”
Not found in BC28-30: table “Tenant Media”.
Context
- Features: HTML image src attribute retrieval, base64 image display, image embedding in web pages, WebPageViewer add-in
Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.