Corrupted table in Navision Attain

Hi, if I created a table not through Design view, that means in the Object Designer, I merely key in the “ID” and “Name”, how to I delete the table? I try to go into Design view but it says “Table test1 is empty”. Then I try to delete it, Navision Attain close off immediately. How do I repair this problem? If u are unsure how I create the table: When I first open the “Object Designer”(Shift+F12), I’ll see the Table, Form, Dataport, Code Unit buttons. So I click on Table button and key in straight from there, without clicking on the New button. Cheers Shel

Select the table line and press F4 (to delete) or right click and delete

Hi, it will crash and exit. Whatever I try, delete, import, rename… it will crash and exit. And when I look into Enterprise Manager, I didn’t see the table. Is there anyway to fix this problem? Because of this, I can’t compile my CodeUnit. I’m using SQL Navision Attain 3.1 Cheers

Are you sure that you created a new table? Did you rename an existing table? You can find out by looking at where your ‘new’ table appears in the object list. If you have renamed a standard table then you must recover the correct version from a different database.

At first I want to agree with Jonathan, that it really looks like you renamed an existing table, sinse that fits nearly all your symptoms, BUT, why is the object empty. It could be that you some how have a miss match between SQL and Navision. Check in enterprise manager, and check if the table exists there, and if so, does it contain data. If it does, then you are going to have to use enterprise manager to recover the data, since it is almost certain that you did a rename. If the table is empty, then my advise would be to go into a new Navision database, and create a new table witht he same name and object number, and then try to improt that FOB into your database, thus deleting the corrupt object. You will then need to go in a fix the Codeunits. Either way, be prepared that this could be a big ob, or you may hit it lucky, and fix it in five minutes. PS as I say everytime to everyone, if you want help, stop keeping secrets. Post all the information at once, instead of just in dribs anbd drabs. So What is the object number, the name of the object, what is its caption, and its name in SQL etc. It can never harm to post all the information at once.

Hi, first of all I did create a table, but not through the proper way. I created the table object through new line in the Object designer. Even if I go to Enterprise Manager to see, I can’t see the table. It should have CompanyName$test1. Even when I open with SQL Navision 4(new version), while converting, it says table test1 is empty and then exit. The table name is test1 with ID 50070. Is there really no way to get rid of this “killer object”?

Shelby, What version on Navision are you using? These empty tables were used in earlier versions (??) to delete unwanted tables from the database during upgrades. However, I have replicated the situation using 3.70B on C/SIDE and I can manage the empty table. Do you have a Solution Developer Licence?

Hi, I’m using SQL Navision 3.1 All the while our application are using that version. I created this test1 table yesterday and since then it cannot be removed. Not even when I open with version 4.0. Yes we have a solution developer license. One thing I’ll like to highlight. In the Enterprise Manager,in DB1, I didn’t see the “test1” table. By right it should have CompanyName$test1. So I proceed to backup DB1. In SQL Navision 3.1, I created a new database call DB2. And then I go to Enterprise Manager to restore DB2 using the backup of DB1. After that I go back to navision and open DB2. However I can see test1 table. I suspect the test1 object exists in some tables as a binary in sql server? I’m not sure about that. I can’t look through all the tables in sql server because there are a few hundreds of tables in there. So I was thinking if the test1 table object really exists as a record in some table, will removing that record help? But first I need to know which table does it store all the navision tables? Cheers

Removing the record is somethng you can try on a test database, but is not likely to work. Maybe the table has the ommonToAllCompanies property, in whcih case it will be listed seperately as just Test1. 50070 is fine, so I am guessing that some how ou have found some bug that allowed you to insert records int eh object designer without the SQl sync occuring at the end. Have you tried Manually creating the table in SQL?

Hi, Have you tried creating a proper table (ID=50070) in another database, exporting it and then importing it into the database in question, thus overwriting the corrupted object? (Edit : Sorry this has already been suggested by David) Another solution might be creating a Codeunit using a recordvariable 2000000001 “object” and then delete data (if any) and the object - something like this: OnRun() IF Object.GET(Object.Type::Table, '', 50070) THEN BEGIN IF NOT CONFIRM('Remove object %1 %2', TRUE, Object.Id, Object.Name) THEN ERROR('Action Canceled'); ObjektData.RESET; ObjektData.SETRANGE(Type, Object.Type::TableData); ObjektData.SETRANGE(ObjektData.Id, 50070); ObjektData.DELETEALL; Object.DELETE; END;

I already suggested importing a new object, and assuming that he tried that, it didn’t work. If we are getting the correct symptoms, then it looks like the Object designer is not allowing the object to be deleted because it contains nothhing, but I have not seen this error before. I think that the actual error message he is getting is top secret, and we are not allowed to know what it is [V]

Hi, even importing the same table name with the same ID, it didn’t work. I also tried to create a table in sql server named CompanyName$test1. It also didn’t work. No impact. No there are no top secrets. Those messages are exactly what I see. Whatever I do, it either crash and exit or pop up a screen saying “table test1 is empty”.

Hi Steffen Voel, I tried to run your CodeUnit. It also crash and exit when it try to delete the table.

Hi again, As David already has mentioned, a bit more details would be nice 1) What exactly happens when you overwrite the object - does it succeed? 2) Have your tried overwriting the object with an object with a different name? 3) What is the blobsize of the object? - is it compiled? 4) Running my codeunit - does it GET the object? 5) Have you tried modifying the object using my codeunit (renaming it, CLEAR Blob-reference) etc.? 6) As mentioned by others, the way you created the object in the first place sounds really implausible - how has it gotten the id 50070 and the name test1?

quote:

Hi again, As David already has mentioned, a bit more details would be nice 1) What exactly happens when you overwrite the object - does it succeed? ans: No. crash and exit. 2) Have your tried overwriting the object with an object with a different name? ans: crash and exit. 3) What is the blobsize of the object? - is it compiled? ans: BLOB size = 0 Date, Time and version List is empty. Compiled has a ticked. but when I try to compile again(F11), it crash and exit. 4) Running my codeunit - does it GET the object? ans: It does prompt me to confirm my deletion of test1 table. Upon clicking yes, it crash and exit. 5) Have you tried modifying the object using my codeunit (renaming it, CLEAR Blob-reference) etc.? ans: it simply crash and exit. 6) As mentioned by others, the way you created the object in the first place sounds really implausible - how has it gotten the id 50070 and the name test1? ans: I created this table. I give the ID and tablename. The way I created it is like adding a new record in “Object Design”.
Originally posted by Steffen Voel - 2005 Jun 15 : 07:13:18

Steffen, I think we jsut have to give up on this, shelby wants us to help him, but doesn’t want to tell us the problem, some people you just can’t help. Why he won’t post the EXACT error messages and sequences is a mystery to me.

Hi, I don’t know what else you want me to contribute. I say EXACTLY what I see and what is happening. It doesn’t give me an exact Error message too. It either crash and exit or pop up a dialog box saying “Table test1 is empty”. That all. Crash and exit means it will pop up the Error Reporting box and then you choose to send to microsoft or not to send. That is all what I see. Anyway I just managed to delete this object. In my post dated Posted - 2005 Jun 14 : 14:42:06, I mention I suspect the test1 table exists as a binary object as a record in some table in sql server. And I don’t know which is the table that contain all navision objects. So now I found the table. It is call “Object” in sql server. I scroll thru the records and I really found the test1 table. So I delete that record and it solve my whole problem. Anyway thanks guys.

Have you tried deleting the bad records from the Object table in your SQL Server database using EM or Query Analyzer (for each Navision table there are two records in Object, a TableData type and a TableDescription type: DELETE FROM Object WHERE [ID] = 50070 AND [Type] IN (0,1) Then you will certainly have no trace of it in the Navision Object designer, since this is a view on the Object table in the SQL database. Then just re-create your table from scratch, using the New button. There have been fixes over the various versions to prevent the creation of bad records like this using the Object designer record list directly - it should not be possible at least from 3.70 onwards. There has also been a fix to the killer object funcionality, which is a separate bug though.

Sorry, didn’t see your final post on Page 2! Remember to clean both records though.

Hi Shelby, looks like you’ve got it fixed now, (it would have been fixed faster if you had been more forthcoming, but…) Anyway as a last precaution, you really should create a full backup, delete the database and restore it again, its really the only way to be sure that its fixed and clean.