web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How can i add a picture to my page card's Picture field of mediaset in AL

(0) ShareShare
ReportReport
Posted on by 75

I've created a table and on that table I've created a Picture field of type MediaSet.

pastedimage1590058658025v2.png

I do know to place a picture i have to use factboxes on card page
pastedimage1590064457970v3.png

for factbox i have to create a Card Part. So i've created one. I took this code from the source code of "Item Picture".

5315.Untitled.png

So the Questions are:
1- Is this right approach ? If yes then how i will upload image in my sandbox environment because on using "File management" codeunit it is showing that it cant be used for extension development.
2- If its not the right approach then what will be the right one to upload a image on a page. So i can read that image using media set.

I just want to upload a image on my card page then want to use that. I cant get the image data form MediaSet picture field because i dont know how to upload the image to  the picture field of my table.

I have the same question (0)
  • Verified answer
    Marco Mels Profile Picture
    on at

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

    Thanks.

  • Verified answer
    Ethan-Sorenson Profile Picture
    225 on at

    Umar,

    I have not tried doing it through the UI, but I was able to upload Item pictures through web services or with a URL provided. I did it using a stream and Temp Blob because I can do "Picture.ImportStream(InStream, FileName, Mime);"

    pastedimage1590589482819v1.png

    I think the easiest way to do it would be to save the file in another location and have a procedure make a web call like this:

    pastedimage1590589663019v2.png

    You can see the full code I used here: https://github.com/ethan-sorenson/ItemImageWebService

  • Umar Khokhar Profile Picture
    75 on at

    Thanks, i will post my next queries on developer forum.

  • Umar Khokhar Profile Picture
    75 on at

    Thanks i've solved this using Instreams. I'm gonna post my code here maybe it will be helpful for others and i also gonna verify your answer so that you can earn your second badge :)

    pastedimage1590786079619v1.png

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans