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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Copying the MediaSet to Blob

(0) ShareShare
ReportReport
Posted on by 4,009

Hi,

I want to copy the MediaSet content blob into an Blob on another table.

I researched about finding where the Blob is stored for the MediaSet and found that it's stored in 2000000184 and 2000000185 tables. When I got the MediaSet Guid  using MEDIAID function, it didn't match the guids in either of the table. Thus, when I checked in table 2000000183 it matched to Is field and I got the Media Index. How do I use media index to fetch the Blob and copy in my record.

Kindly advise!!

Thanks.

Categories:
I have the same question (0)
  • Suggested answer
    I Gusti Made Ari Profile Picture
    3,608 on at

    Below sample on getting item picture from media rec :

    Item.GET('ItemNo');

    IF Item.Picture.COUNT = 0 THEN

       EXIT;

    FOR index := 1 TO Item.Picture.COUNT DO

      MediaRec.GET(Item.Picture.ITEM(index));

      MediaRec.CALCFIELDS(Content);

      IF MediaRec.Content.HASVALUE THEN BEGIN

         MediaRec.Content.CREATEINSTREAM(Instr);

         MemoryStream := MemoryStream.MemoryStream();

         COPYSTREAM(MemoryStream,Instr);

         Bytes := MemoryStream.GetBuffer();

        Picture.ADDTEXT(Convert.ToBase64String(Bytes));

       END;

    source :

    blogs.msdn.microsoft.com/.../working-with-mediaset-references-in-microsoft-dynamics-nav-2017

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans