Can't delete table or records

FishermanFisherman Member Posts: 456
All -

I was trying to create a working area that mimics the item table. I right-clicked & copied the Item table in the Object Designer, and then pasted it. I gave it a new name ('New Item Quick Setup') and a new ID (50006). There is one record in that table.

I can't delete the record... and I can't delete the table because it has a record in it. When I try to delete the record I get an error that says...

"The tables are incompatible.

Table 1: Item
Table 2: Item"

Anyone have any ideas?

Answers

  • krikikriki Member, Moderator Posts: 9,118
    Create a form on that table.
    In the OnOpenForm, put "DELETEALL(FALSE);" and run the form.
    The form will showup without records because they just have been deleted.

    Be carefull, if you have the wrong table, you can destroy your database so that you need to restore the latest backup!
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • FishermanFisherman Member Posts: 456
    Thanks - kriki - worked like a charm.
  • SavatageSavatage Member Posts: 7,142
    There was a discussion about cutting & pasting instead of using "save as"

    http://www.mibuso.com/forum/viewtopic.php?t=8760
  • FishermanFisherman Member Posts: 456
    Thanks, Savatage - that's very useful info!
  • kinekine Member Posts: 12,562
    You need to clear the C/AL code in the OnDelete, because there is application logic which is correct for Item table, but not for your new table. You need to check the code and modify it or remove it...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.