Skip to main content
Business Central forum
Suggested answer

Tenant Media Table

editSubscribe (0) ShareShare
ReportReport
Posted on by 10

Hi 

We have a Tenant Media table which has over 45gb of data in there, containing a mixture of image/jpeg, image/png and application/octet-stream Mime Type files.    The table has become too large and we need to clear this down or find out what keeps on populating this table. 

The content column on the Tenant Media and Tenant Media Thumbnail tables are blank. 

I have checked the Customers, Vendors, Items and Contacts pages and cannot find any images being used anywhere.   

Does anyone know how I can see where the media is being used?  Either functionally via Business Central or via VS Code? 

Thanks

Gurpal 

Attachments
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 59,978 Super User on at
    RE: Tenant Media Table

    Hi, I just did a simple test, hope it helps you.

    More details: https://yzhums.com/26326/

    Thanks.

    ZHU

  • Gurpal Profile Picture
    Gurpal 10 on at
    RE: Tenant Media Table

    Hi Zhu

    Thank you for the reply, I've been looking into this one today and cannot see a way of exporting directly out of the Tenant Media table.  

    The link you provided assumes that you wish to export the current media object (such as a JPEG image) that is being used on a record to an OUTSTREAM object.

    In the example code in the link where it states:  myItemRec.Image.ExportStream(dataOutStream);

    I cannot see that there is any suitable field on the Tenant Media Table to use in place of "Image".

    Would I need to follow the example in this link:

    Working With Media on Records - Business Central | Microsoft Docs

    So that once I have copied each media field to a record in a new table, then use the example that was provided in the link you shared to export the media?  

    If you know of an easier more efficient way to do it, I'd love to hear it.

    Thanks

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 59,978 Super User on at
    RE: Tenant Media Table

    Hi, I know this is not a good way.... You can export all contents using the following method. . . Then check what exactly is the problem. . But there is 45G. . .

    pastedimage1654563642564v3.png

    https://docs.microsoft.com/bs-latn-ba/dynamics365/business-central/dev-itpro/developer/methods-auto/media/media-exportstream-method

    pastedimage1654563612767v2.png

    PS: In the previous version of BC, we could directly see the pictures in the Content on the Web Client, but now it doesn't seem to work.

    BC16:

    pastedimage1654563800269v4.png

    BC20:

    pastedimage1654563850204v5.png

    Hope this helps.

    Thanks.

    ZHU

  • Gurpal Profile Picture
    Gurpal 10 on at
    RE: Tenant Media Table

    Hey,

    Item cards have no images.

    The lines on the Incoming Documents page do have attachments but they are not present on the Tenant Media table.

    Posted Sales Invoices and Posted Purchase Invoices do have attachments showing on the Tenant Media Table dating back to 2019.

    So I think that pretty much answers why the Tenant Media table is so large

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 20,984 Super User on at
    RE: Tenant Media Table

    Hi,

    can you please check if any images added to the items card, incoming documents, any attachments in posted invoices either sales and purchases?

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,080 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,601 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans