Business Central Multiple Item Images 🖼️

The item table picture field is a field type of “MediaSet” – most of the other tables holding images have the same (customer, vendor, employee etc.):

Which means you can store multiple images other other media content. However, when you try to import another image for an item which already has one you get this confirmation message:

Similarly with the BC API you cannot add another image it will only offer replacing the existing one. Is there a way around this? Of course there is! Once you have multiple images you can do some other cool things to enhance the user experience. I found when adding many images to a mediaset was easy but displaying them was a better challenge.

Code is available at the end but here are the capabilities I had a play with. Big caveat would be it is recommended not to hold high resolution images and especially large quantities of them. However, MediaSet exists as an option so why not know the overall set of options?

Adding an additional item image:

Drilldown to all the assigned images:

Factbox which let’s you toggle between item images with a few variations on how it looks:

A grid view of all assigned item images:

Deleting is a bit odd as you delete from the Tenant Media table but the Item.Picture.Count still keeps a count. Something else would be needed here I’m sure:

Conclusions are that you can work with multiple images and show them in some cool ways too. Still a good idea to use the “Links” feature though so you can store this kind of data elsewhere and prevent bloating the size of the database and of course impacting on performance. Page loads aren’t too bad if the user is deciding to open a view for the images. The factbox stuff would need fine tuning if to be used. This post represents a good alternative: https://joshanglesea.wordpress.com/2020/08/14/business-central-to-sharepoint/

Any code I used to build these demos: https://github.com/JAng13sea/Blogs/tree/master/Item%20MediaSet

3 thoughts on “Business Central Multiple Item Images 🖼️

Leave a comment