BC Idea | Item Variant Pictures

Items can have pictures, so why can’t Item Variants have pictures? That’s something one would think when reading Gary Frostick‘s Idea, that had gathered 67 votes since it was posted back in 11/27/2019.

Here’s Gary’s idea:

Item variants are typically used when there are variations of a product available such as a colour or size. It would be very useful to be able to load a picture specifically for an item variant so when viewing the list the user can see the differences in variants.

And this is true. Even though I don’t see a lot of customer using Item Variants for all the different reasons, I think this idea would be easy enough to implement to cover for those customers that indeed use Item Variants in their processes.

I don’t think there’s a lot of challenges here, so let’s just jump into the implementation of this idea. 🏃‍♀️‍➡️

Implementation Details

The very first thing we need to do is to actually create a MediaSet field on the Item Variant table to hold the actual image. There’s no mistery here, it was done using a Table Extension.

The next question is: Where, or How am I going to let the users see and assign pictures to the variants? And this is where we have to stop to think a little more, because we want to provide something functional, but we don’t want to break Business Central patterns.

My mind immediately went to showing the picture on a FactBox on the Item Variants List page. But if you check the Item List or the Customer List pages, they do not provide a Picture Factbox… Why is that?

The answer is: Tiles open_in_new! If you want to see the pictures assigned to Items, you should not be viewing lists as Lists, you should be viewing them as either Tiles or Tall Tiles:

Item List displayed as Tiles

Therefore, on my Item Variant TableExtension, I needed to create a fieldgroup named Brick, to hold the fields that I would like displayed as Tiles (including the picture), as documented by Microsoft open_in_new.

Once that was done, look at what I got:

Some pretty neat and colorful Conference Bundle variants…

What Else…

Well, items can be copied using the Copy Item action from the ribbon… Therefore, we cannot forget to handle Item Variant Pictures during the copy process. So, I went ahead and created a new flag on the Copy Item routine:

This new toggle will only be VISIBLE, if the Picture on Item Variants idea is enabled on the BC Idea Feature Management page.
Once visible, this flag will only be ENABLED, if the Item Variants toggle is also turned on. Otherwise, the toggle will be disabled.

Warning: Microsoft Implementation ⚠️

After I went ahead and did this whole development, I noticed on the BC Idea that Microsoft also opened this one up for Open Source contribution through their Base App Contribution program on GitHub.

With this, you should be seeing a replacement to this sometime soon in the future. When I detect that this has been implemented in the Base App, I’ll mark this idea as deprecated, since you should prefer to keep your Master Data on official Base App tables and fields whenever available.

I’ll possibly provide a tool to copy pictures from this idea extension to Microsoft’s official architecture too… Let’s see how that goes.

Disclaimer

As usual, if you do enable this BC Idea, please use it at your own risk. Truthfully there’s not a lot of risk here but you have to be mindful of any potential conflicts with other existing extensions in your environment. Also, don’t forget to always try these features in a Sandbox environment first, and have users test it before really deploying to Production.

That’s it! 🎉

If you liked this idea, this development, or if you have questions or comments about this, don’t hesitate to react and/or post on the discussion below (you will need a GitHub account).