Cannot delete,replace,design table

Jan87Jan87 Member Posts: 26
Hello,
we are using NAV5.0 SP1 and a native database.

Let me describe the situation.
At first my workmate imports an table with two new fields. Then she fills the table with data.
After that we have to delete this fields. So she had to replace the table.

But she did not erase all data from the table and while importing got the error. Normally there is a rollback then, but the table was partly replaced. for example the new fields are away and the date of the last modification is set to the new one.

After that, the table behave very strange. Everytime we want to delete, replace or design it, there is the error that
"Another user has changed the definition of the Tabname table after the activity was startet. Start again."
It occures that there is data in the table in two companies, but while trying to open the table in these companies the same error occures. Even if I go File>Database>Information there is the error when the table from that companies should be shown.

I hope someone can help me.

Sorry for my bad english and thank you for trying to help.

Comments

  • arcullarcull Member Posts: 191
    In order to delete the table data and table structure, you could try to create new form based on table "Object" and delete the appropriate records from there.
  • RawHeatRawHeat Member Posts: 63
    hi,
    if you want to delete the table then just delete the entire code in the table. Run the table and then remove all the records.
    It would surely remove all the records.
    you can then import you new tables.
  • Jan87Jan87 Member Posts: 26
    hi
    thanks for the fast reactions.

    I have tried the Object-Table, but NAV didn't let me delete it. There was a Error like "you are not allowed to delete records".

    RawHeat, there is one small problem, I can design it and delete all code, but when I want to save the errormessage comes again. Therefore there is no was to do what you suggested.
  • SavatageSavatage Member Posts: 7,142
    how about a report with dataitem= your table

    onaftergetrecord()
    "your table".delete;

    should clear your table
    once empty you should be able to delete the table
  • RawHeatRawHeat Member Posts: 63
    hi,
    what is the error that comes when u try to save the object table??/
  • garakgarak Member Posts: 3,263
    if you doen't need the data try following (if you need the data try to export)
    Create a function to delete all recs in this table in all companies.
    RecCompany.reset;
    RecCompany.findset(false);
    repeat
      YourTable.changecompany(RecCompany.name); 
      YourTable.deleteall;
    until RecCompany.next = 0;
    

    If the table is empty try to overwrite this table with a new table (object designer -> new table -> save this new table under the same id like the damedged table).
    If you have a backup of your old (runable) table import this now (only if you need this table).

    Does this work?

    Regards
    Do you make it right, it works too!
  • Jan87Jan87 Member Posts: 26
    @RawHead it is the same error.

    @garak and savatage
    nice ideas, but unfortunately with no good result. I got the same error both tries :(.
  • DaveTDaveT Member Posts: 1,039
    Hi,

    A long shot - there is a system table 2000000041 Field which stores the corresponding structure of a table. Try to edit this to what the complied version of the file to see if it fixes the problem.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Are you able to create a new table in a seperate database, with these two fields, then import that object?

    If you can't import, then try merge.

    I would say though that if you are in this position, its not good. If you try to create a backup, does it give an error about a corruption in the database structure?
    David Singleton
Sign In or Register to comment.