
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.
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