Deleting tables with fob import

grouicgrouic Member Posts: 34
Hello,

I identified many tables I want to delete in my NAV4 C/side database.
I made a backup of all those tables in a fob.
All the data have been removed manually on all the companies.

I thought I can delete those tables by importing my bckp fob, and put the option "Delete" on all objects.
It doesn't work, saying that the table must be empty. I red the help, a 0 size is needed ??? How can this be possible ?

Any idea where my process is not good ?

Thx

Grouic

Comments

  • davidecdavidec Member Posts: 63
    Indeed a table must be empty to be deletable (not to risk losing used/useful data). It's a rule enforced by NAV.

    According to the tables you want to empty and your permissions, you can basically use a codeunit to empty them all (you'll need to reference the appropriate "Record" variables), open them one by one from Object Designer and delete all rows (selecting them with the top left cell), empty them from their relative form...

    Hope this helped...
  • MalajloMalajlo Member Posts: 294
    interesting... I never noticed option Delete ;)
    Mark tables in Object designer and delete them. Tables must be empty in all companies.

    Delete
    The existing object will be deleted and no new object created. This option is only valid if the new object has size 0. The intended use is to remove obsolete objects from the database. A new object that has this function is sometimes called a 'killer object'.
  • munib00munib00 Member Posts: 29
    To delete any table. The table has to be empty.
  • grouicgrouic Member Posts: 34
    As I said above, all data have been removed on all companies.

    I think a table cant have a bloze size = 0

    Weird. I'll delete all my tables manually on my different environnements. ](*,)
  • grouicgrouic Member Posts: 34
    In fact I'm wondering what is this "delete" option made for, it doesnt work for any type of object (Tables, forms, report ...etc)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    grouic wrote:
    In fact I'm wondering what is this "delete" option made for, it doesn't work for any type of object (Tables, forms, report ...etc)


    The killer object is mainly designed to be used by ISVs in reason to Add-Ons and Verticals. Mainly because you don't want your database filled with unused objects. Especially when the Add-On is moved to a new number range.

    Partners can also use them to remove old objects form clients databases. For example once Data conversion is complete to remove all the unnecessary objects, say forms and tables that are outside the Clients license range.

    In the real world not too many people use them. I think these days they don't even cover them in training classes.
    David Singleton
  • kinekine Member Posts: 12,562
    Killer object can be created, only if you have permissions to create the object with selected ID. And why to do it in this way, if you have this permissions? You can delete it directly... it is good only if you want to send FOB to your customer for import and delete some table "remotely" in this way. Than you just needs to open Object Designer, go to tables, scroll whole way down until new line is created, enter the ID and some name, save the record. New object with 0 size will be created. When you export it as FOB and you try to import it, the DELETE option will be automatically set...but, as you can see, you can use it only in limited cases and in some NAV versions it is problem to even export/import this killer object...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.