Unable to delete a record in NAV2013

This is driving me insane - I am doing a test upgrade for a client and I need to delete all entries from the dimension value table - Really simple...

So i created a process to loop through all the companies and then changecompany on the dimension value table and deleteall(false) - got an error so did a loop and if DimVal.delete then;

works on every single record bar 1 - the same value remains in all of the companies.

The odd thing is - if I go into the client and delete the record it deletes - but if i come out of the page and go back in again it reappears.

If i try to modify the record |(tick blocked) - it says that the record does not exist

If i run the table in SQL then the record can be deleted - but as there are over 100 companies in the database i dont want to manually delete the enrties.

I have hotfixed the 2013 client to CU51 but still no joy

Anyone else had a similar issue?

Answers

  • LinLin Member Posts: 40
    We have had something very similar with the an item record caused by a special character in the primary key i.e. in the "No." field.

    You can clean up this record by using wildcards in filter to locate the record and then delete it.
    Here is some example code if you are trying to delete a Dim value for ANALYSIS,A100 :

    DimVal.SETFILTER("Dimension Code",'ANALYSIS*');
    DimVal.SETFILTER("Code",'A100*');
    DimVal.DELETEALL(FALSE);

    NOTE: A GET will not work with these corrupt records.

    Hope this works for you.
Sign In or Register to comment.