Please wait
Talk to Expert
Microsoft Dynamics 365, Microsoft Dynamics Business central, Visual Studio Code

Image Handling in Business Central: Transitioning from BLOB to Media and MediaSet Data Types.

Image Handling in Business Central

In Dynamics 365 Business Central, handling images and other binary data has evolved significantly with the introduction of the Media and MediaSet data types, replacing the traditional BLOB (Binary Large Object) approach. This transition offers various benefits in terms of efficiency, scalability, and ease of use.

Uploading media using BLOB data type:

You can add media to a BLOB data type field on record (table).

Example: In company information, picture is stored using BLOB. See BLOB Data type.

 

Uploading media Using Media/ Mediaset data type:

This method stores media in system table of database, and then reference the media from record.

Example:

  • Display media with records in list type pages when the page is viewed in the Tile For more information, see Displaying Data as Tiles.
  • Display media on a card type page for a record.
  • Display media in a report.

Customer Picture: Media Data Type

Item Picture: Mediaset Data Type

  • Using the Mediaor MediaSet data type provides better performance than using a BLOB data type and is more flexible in its design. With a BLOB data type, each time the media is rendered in the client, it’s retrieved from the SQL database server, which requires extra bandwidth and affects performance. With the Media and MediaSet data types, the client uses media ID to cache the media data, which in turn improves the response time for rendering the media in the user interface.
  • Imported media is stored as an object in the system table 2000000184 Tenant Mediaof the tenant database. Each media object is assigned a unique identifier (ID).

Example:

We are creating the Sales Order custom (RDL) report in which,

  1. We want to print Customer picture.

Source Code:

  1. We want to print Item pictures in sales lines.

Source Code:

A media set is an ordered list of media objects, determined by the order in which the media objects were added to the media set. This order can’t be changed. To identify this order, each media object is assigned an index number, starting with 1. The first media added gets the index 1, the second media gets the index 2, and so on. If a media object is removed from the set, the list is reindexed.

Report Output:

Thank you for investing your time to read our blog! We’re passionate about sharing valuable insights to help you navigate the world of Business Central.

If you’re curious about how we can assist you in reaching your goals, don’t hesitate to get in touch. Our dedicated team is ready to provide support every step of the way.

Let’s turn your vision into reality together!


Comments