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 :
Small and medium business | Business Central, N...
Suggested Answer

Delete mediaset and its' tenant media

(0) ShareShare
ReportReport
Posted on by 50

Hi,

I want to remove a picture in item via functions and i'm writing this.

The problem is, even if the picture deleted from the mediaset field, it wasn't deleted in tenant media. What's the connection between this and the tenant media ?

    procedure DeleteItemPicture(parItemNo: Code[20]ReturnVal: Text
    var
        Item: Record item;
        B64cu: Codeunit "Base64 Convert";
        TM: Record "Tenant Media";
        MediaGUID: Guid;
    begin
        item.get(parItemNo);
        if item.picture.Remove(item.picture.Item(1)) then begin
            item.modify;
            exit('delete done');
        end else
            exit('delete can not be done');
    end;
I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    You can retrieve the Tenant Media record connected to the picture field by doing:

    TenantMedia.Get(Item.Picture.Item(index)) and then delete it.

  • Zdenek Zert Profile Picture
    10 on at

    Be careful. if you use item.picture.Remove... records in Tenant Media and Tenant Media Thumbnails tables will remain - and you will lose link to original item, so you won't be able to distinguish, what tenant media record belongs to which record in database.

    The only completely working way seems to be:

    CLEAR(Item.Picture);
    Item.MODIFY()

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,005 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,148 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans