Delete Dimension Values

In my test environment I have a bunch of Dimension Values I want to get rid of. There haven’t been any postings on those values. When I do it manually, it takes about a minute to delete one dimension value. Is there a ‘quick and dirty’ way to achieve this (I’m not a programmer, but I manage to do some C/AL coding in Reports and Dataports [;)])?

Make a new Report or Dataport and create a global variable: Name DataType Subtype Length recDimension Record Dimension The code you need will be “recDimension.DELETEALL;” If you use SetRange or SetFilter first, only the selected records get deleted.

quote:


Originally posted by PeterD
The code you need will be “recDimension.DELETEALL;” If you use SetRange or SetFilter first, only the selected records get deleted.


Thanks Peter, I followed your instructions (report with Data Item ‘Dimension Value’ and saw my Dimension table (348) been emptied [:D]. But I want to clean up some values in the Dimension Value table (349) with a specific Dimension Code (KLANTEN). You talk about SetRange or SetFilter; how should I use these? And in which section of the report should I write your code?

In version 3.10 and 3.01 of Navision Attain there was a bug that made dimension value deletion extremely slow. Perhaps this is the cause to your problem also. You need to set this line LedgEntryDim.SETCURRENTKEY(“Dimension Code”, “Dimension Value Code”); in function CheckIfDimValueUsed in table 349. Also this line PostedDocDim.SETCURRENTKEY(“Dimension Code”, “Dimension Value Code”); This atleast helped us. Best Daniel

Daniel, Thank you very much. From over 1 minute to 8 seconds per record! [:)] I also needed to add a key ‘Dimension Code,Dimension Value Code’ in tables 355 and 359.

[:I]

I’m learning all the time, Peter. Thanks.