Skip to main content

Notifications

Announcements

No record found.

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

Tenant Media Table

(1) ShareShare
ReportReport
Posted on by 14

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 

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 74,149 Super User 2024 Season 2 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 14 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 74,149 Super User 2024 Season 2 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 14 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 21,091 Super User 2024 Season 1 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?

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,543 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans