Media Set cleanup

JuhlJuhl Member Posts: 724
Hi everybody

I have played around with the new Media / Media Set function in NAV2017, and are planing to use it for an upcoming implementation at a customer.
But in my testing i also found, that NAV does a bad job of cleaning up.
If you delete an Item, then it deletes all the related pictures and thumps, but if you upload a new picture to replace the existing, the old picture and thumps are left behind parentless.

Is this maybe by design, i don't think so because i cant find a way to link the data back, so not much of an archive there.
Is it a bug?

My customer has around 20GB of pictures, that change a lot. This could fill the db with junk.
Normally i would create a table for the pictures to avoid perfomance issues, as MS has done with this new feature, but if it leaves a mess then....?

We have to remember that Media handles thumps for webclient and app, this will not be the case if I use a custom table.

Any ideas og knowledge regarding this issue and the way to go.

PS.
I can do a manual cleanup!
Follow me on my blog juhl.blog

Answers

  • nhsejthnhsejth Member, Microsoft Employee Posts: 34
    Hi,
    The old media and thumbs should be deleted when you import a new media item on the field, but the delete will only take place when the modify trigger runs as the logic that cleans up runs when the OnModify trigger is executed on the parent record. I will verify the issue and get it fixed if it reproes on my system. Please feel free to send me a simple repro setup if feasible for you.
    _________________
    Niels-Henrik Sejthen
    Senior Software Developer
    Microsoft Dynamics NAV

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • JuhlJuhl Member Posts: 724
    Hi Niels-Henrik

    Could it be related to the fact that the Picture field on Item is replaced by Media Set and not Media.
    Media Set can hold multiple pictures, but the picture factbox on item behaves as a single picture only, and that is the old behavior as well, when it was a BLOB field.
    Maybe the field should have been a Media field instead?

    I also tested deletion of picutre, and that is NOT working either !!!!
    You have to delete the Item before it is cleaned up.
    If you deleted Picture and then the Item, then the link is brokken as well, and the pictures are left.

    Mayby some of the business logic is handle behind the scenes, but i cant find any code on Item table in any trigger regarding this, nor see any Events subscribing to the Item table, that performs cleanup.

    Is it correct that it uses the Tenant Media tables even if I am not using multitenancy?

    Just tested again in Cronus, and the result is the same.

    Thanks for dealing with this, and help us get a even greater product :-)
    Follow me on my blog juhl.blog
  • JuhlJuhl Member Posts: 724
    Any news on this?
    Follow me on my blog juhl.blog
  • CrunchCrunch Member Posts: 38
    Any news?
  • JuhlJuhl Member Posts: 724
    I have created a new field of type Media in Item table, and are gonna use this instead.
    The database is simply going to grow to fast if not, as the customer stores 300dpi pictures.
    Follow me on my blog juhl.blog
Sign In or Register to comment.