Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Display Media (or BLOB) on page based on selection in a different field

Posted on by 30

I have a question on something that I'm sure is possible, I just haven't figured out exactly how to code it yet.

I'll explain using a simplified example:

Lets say I'm a green-grocer and sell all sorts of varieties of apples, bananas and oranges.  I want a generic image of an apple, banana or orange displayed on my Item cards based on the selection of some field.

To keep it simple and separate from all other BC stuff, lets say I add a new option field [Product Type] with the options 'Apple', 'Banana' and 'Orange'. So when I select 'Apple' the image of an apple is displayed on the Item page.

Now I understand I can just upload the image of an apple into the existing picture field on the item card, but if I had 100 varieties each of apples, bananas and oranges I don't want to have to import the same 3 images 300 times. I'd rather just set the Product Type and the image displays accordingly.

I'm thinking I'll be using either the MediaSet system table, or given the smallish number of images perhaps just create a new table ProductType which stores the Image along with their corresponding Product Type Code.

Thanks in advance

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,696 Super User 2024 Season 2 on at
    RE: Display Media (or BLOB) on page based on selection in a different field

    Hi, I made a simple example, hoping to give you some hints.

    Dynamics 365 Business Central: How to add a picture to Item Category (Manage item picture by group) – Customization

    https://yzhums.com/34480/

    Thanks

    ZHU

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans