• Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ

Olof Simren - Microsoft Dynamics 365 Business Central Blog

  • Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ

Record Deletion Tool for Dynamics NAV 2015

November 17, 2014 Posted by Olof Simren Development, General, Miscellaneous 39 Comments

Several people that have read my previous post, Run Objects in NAV 2013 using GETURL, has asked me about the record deletion tool that I was working on. So, here it is! 🙂 It is available for NAV 2015 on the downloads page.

This data deletion tool is useful if you want to ‘clean’ a company from transactional data. It could for example be that you have been testing transactions in a company that you want to use for a go-live or you just want to have a clean company without transactions for a demo, training or testing session.

Here is how it works;

Import the objects that can be downloaded from the download page, they are all stand alone in the 50090 range. You will need a developer license to delete records in protected tables.

Objects-Record-Tool-Dynamics-NAV

Run page 50090 and then click Insert/Update Tables. This will populate the list with all the tables that are in the database. If you afterwards add new tables you can run this function again to have them added.

Update-Tables-Record-Deletion-Tool-Dynamics-NAV

Then you go through and select the tables you want to delete records from by checking the Delete Records field. The function called Suggest Records to Delete will select the tables you typically want to delete records from when cleaning a company from transactional data. Note that the selection of tables in this function is based on a W1 version of Dynamics NAV 2015. If you have a localized version, any add-ons or customizations then you will need to review those tables and manually select additional tables to delete records from. Also note that I am not responsible if this suggestion selects something you don’t want to delete or skips something that you do want to delete. 🙂

Suggest-Records-To-Delete-Record-Deletion-Tool-Dynamics-NAV

The Clear Records to Delete function removes all the selections.

When you are happy with the selection you press Delete Records. Dynamics NAV now goes through the tables and deletes all records from each of the selected tables. It might make sense to do a backup of the data before you do this. 🙂 I typically just copy the company before this step, so at least you have a company that can easily be restored or copy/paste data from.

Delete-Records-Deletion-Tool-Dynamics-NAV

After the records have been deleted it is recommended to review the tables that still have data in them to make sure you have not missed anything. The easiest way to do this is to just apply a filter on the No. of Records field to be <>0 and use the View Records function to view the records in the tables.

Review-Record-Deletion-Tool-Dynamics-NAV

When selecting View Records the table will be run to show all the records and all the fields, like below.

View-Records-Record-Deletion-Tool-Dynamics-NAV

When looking at the records it is typically quite easy to see if they should have been deleted or not, if the records has an entry number, document number, etc. it is most likely transactional data that should be deleted. The number of records in the table could sometimes also give you a hint if it should be deleted or not.

The next option when reviewing the remaining data is to use the Check Table Relations function. This function runs through all records and uses the field relations defined in the Field table in NAV and validates the table relations by just looking if the related record is in the database or not. Note that this only checks the very basic relations where a field has a table relation to a field in another table (similar to the table relations you find in the FactBox in the configuration worksheet). It does not check table relations that involves multiple fields or conditional table relations. But it is still a good check I think.

Check-Table-Relations-Record-Deletion-Tool-Dynamics-NAV

After the check on the table relations has run you can set a filter on the No. of Table Relations Errors to be <> 0 and you should see if there are any basic table relation errors.

Table-Relations-Errors-Record-Deletion-Tool-Dynamics-NAV

If there are any errors you can make a drilldown on the number to see the errors. In the below example you see that the Shipping Agent Codes ‘DHL’ and ‘UPS’ are on some of the Customers but they do not exists in the Shipping Agent table.

Table-Relations-Errors-Log-Record-Deletion-Tool-Dynamics-NAV

As mentioned above the table relation check is only doing a basic check, so don’t rely too much on it. If you have a large amount of master data it might also take a while to run.

As a side note; if you are preparing a database for go-live like this then remember to also review and reset the number series. And remember to always test the final result.

Share this:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X

Related


Discover more from Olof Simren - Microsoft Dynamics 365 Business Central Blog

Subscribe to get the latest posts sent to your email.

Tags: Data DeletionGo-LiveNAV 2015Record DeletionTool
39 Comments
Share
10

About Olof Simren

I am a Microsoft Dynamics NAV and 365 Business Central Expert, I started implementing Microsoft Dynamics NAV in 2002, back then it was called Navision Attain. Throughout the years there has been many exciting implementations in different parts of the world, all of them with different challenges but with one common theme; manufacturing. As a consultant, I bring over 20 years of experience in implementing Microsoft Dynamics NAV and 365 Business Central within manufacturing and distribution companies. The services I offer includes project management, consultation, development and training. Feel free to contact me if you need help with anything related to Microsoft Dynamics NAV or 365 Business Central. I work through my company Naviona where I team up with other skilled Microsoft Dynamics NAV and 365 Business Central Experts.

You also might be interested in

Functionality Improvements in NAV 2015

Oct 14, 2014

Microsoft Dynamics NAV 2015 was released a couple of weeks[...]

Autofill Variable Name in NAV 2015

Apr 16, 2015

By accident I discovered something quite interesting last week and[...]

39 Comments

Leave your reply.
  • Tommy Pedersen
    · Reply

    December 9, 2014 at 8:47 AM

    Can the Tool be used for NAV 2013 / 2013R2 ?

    • Olof Simren
      · Reply

      Author
      December 9, 2014 at 4:57 PM

      Hi Tommy,
      I believe you can just import the 2015 version objects to a 2013 database, compile and run them.

      /Olof

  • Anthony
    · Reply

    February 17, 2015 at 6:46 AM

    Hi, great blog. Very informative especially in Dynamics NAV 2015. Will keep checking on the website for new info. Cheers!!!

  • Carlos
    · Reply

    April 21, 2015 at 7:53 AM

    Very useful!. Many thanks Olof.

  • Lucky
    · Reply

    May 6, 2015 at 10:44 PM

    Can the Tool be used for NAV 2009R2 ?

    • Olof Simren
      · Reply

      Author
      May 6, 2015 at 10:59 PM

      You will have have to recreate the objects, but the concept can be used in NAV 2009 R2 as well.
      Not sure if the ‘GETURL’ syntax existed in NAV 2009 R2 though, so you might have issues with creating the action item that runs the table. I know in the classic client it will not work.

      /Olof

  • Brenie B
    · Reply

    December 2, 2015 at 1:32 PM

    I have downloaded this tool and changed my license and tried to run the page 50090. I receive a permission error. You do not have the following permissions on Table Record Deletion Table: Execute

    I am setup as Super and I even added the specific permission but it still doesn’t work. Any ideas?

    By the way great blog

    • Jariel Menguito
      · Reply

      February 12, 2017 at 12:36 AM

      HI Brenie, How did you fixed the error you’ve mentioned? I have the same problem. I cannot open the page.

  • Brenie B
    · Reply

    December 3, 2015 at 10:16 AM

    I figured it out. Great tool!

    • Andrei B
      · Reply

      November 13, 2019 at 8:52 PM

      What was a solution to You do not have the following permissions on Table Record Deletion Table: Execute Error> Thx!

  • Rahul
    · Reply

    January 10, 2016 at 9:20 AM

    Thank You tried it in 2013 R2. Its working fine.

  • Dave W
    · Reply

    January 11, 2016 at 12:01 PM

    Hi Olof,

    Thanks for this tool, it has been by far one of the most useful tools I have this year. I have not tried it in NAV 2016 yet, is there any intention to update it for 2016 at all?

    • Olof Simren
      · Reply

      Author
      January 11, 2016 at 12:28 PM

      Hi Dave,
      Thanks for your comment.
      My plan is to update it, just haven’t got the time yet.
      I believe the same objects will work for 2016, except for the feature that runs the tables to show the data.

      /Olof

  • Dave W
    · Reply

    January 12, 2016 at 7:09 AM

    Hi Olof,

    Many thanks for the fast response. It is great that you plan to update it. I will keep an eye on this thread to see if any update is posted in the coming weeks/months. I will test it in 2016 as soon as I am able.

    Thanks again for making this available.

  • Dominik
    · Reply

    February 18, 2016 at 10:34 AM

    This tool works great and saves me a lot of time, thank you very much for providing!

    Thumbs up!

  • Gulli Gudmundsson
    · Reply

    June 16, 2016 at 6:18 AM

    Hi Olof,
    Great tool, helps a lot in creating a new Live company. I imported the objects into NAV 2015 and am getting very slow performance. Tested this locally on my laptop and on a production server. It’s really, really slow. Most of the time is spent waiting. A point of improvement for future releases. Or do you have any hints in how to speed it up?
    All the best
    Gulli Gudmundsson

    • Olof Simren
      · Reply

      Author
      June 16, 2016 at 9:36 AM

      Hi Gulli,
      What part is slow?
      Is it the function that checks the table relations? I can see that that could take a while if you have a lot of data left after deleting transactions etc.., I am not sure how it could be speeded up though.

      /Olof

      • Gulli Gudmundsson
        · Reply

        June 19, 2016 at 2:01 PM

        Olof,

        Just scrolling the table list is slow. 20 seconds to update a Page Down, 55 seconds to delete a table with 13 records…

        I guess it has to do with SIFT indexes or SQL indexes on the table. You might consider to optimize the keys somehow.

        Gulli

        • Olof Simren
          · Reply

          Author
          June 19, 2016 at 4:47 PM

          Hi Gulli,
          What build no. are you on?
          And do you have a lot of companies in the database?

          /Olof

  • Astur Iano
    · Reply

    June 20, 2016 at 8:01 AM

    Just a short note: I have used it in a NAV2016 and works fine.
    The truth is just 3 companies in it and not very heavy load of old transactions.

    • Olof Simren
      · Reply

      Author
      June 20, 2016 at 8:42 AM

      Thanks for your feedback Astur!
      I have not had any performance issues either.

      If it is slow then it is probably due to a bug related to the ‘Table Information’ virtual table.
      The solution uses this table to lookup the number of records in each table.
      Platform hotfix 378726 in Cumulative Update 19 for NAV 2015 should fix this issue.

      /Olof

      • Nancy
        · Reply

        June 30, 2017 at 1:07 PM

        This is awesome! I’ve been using your tool, and have it working in NAV2016 as well. However, the virtual table Table Information in NAV2016 does not provide the record count. Only a few Custom tables show the record count, but no standard tables. Have you encountered this and is there an answer for this?

        • Olof Simren
          · Reply

          Author
          July 20, 2017 at 2:44 PM

          Hi Nancy,
          You can look at the ‘GetNoOfDatabaseRecords’ function in table 8622, this is used in the Config. Worksheet page.
          Not sure if I like this option, but it is at least an example of how Microsoft have done it.

          Hope this helps.

          /Olof

  • Brian
    · Reply

    August 8, 2016 at 2:42 AM

    Super tool, thanks.
    Have now replaced my own codeunit, as its much easier to add custom tables.

    Mayby you should add Companyname to the delete dialog, so one is aware of what company we are delting from.

    DeleteRecords()
    IF NOT CONFIRM(Text0001 + ‘ for ‘ + COMPANYNAME, FALSE) THEN
    EXIT;

  • Cindy Colonna
    · Reply

    November 15, 2016 at 12:39 PM

    Just wanted t o say thanks for this tool – I continue to use it and it works great. I appreciate you sharing!

  • Maarten
    · Reply

    January 4, 2017 at 12:08 PM

    Olof, very nice and usefull tool.
    I submitted an issue in connect to ask for the full database test functionality: https://connect.microsoft.com/dynamicssuggestions/Feedback/Details/3117990

  • Pollux86
    · Reply

    March 28, 2017 at 7:56 AM

    Hello Mr. Simren,

    I have installed your module in our Nav. 2015. Unfortunately when I run it i get the following message: “You don’t have the following permisions on Table Record Deletion Table: Execute. ” . Is there any way ti fix it within our user licens’s license?

    • Olof Simren
      · Reply

      Author
      March 28, 2017 at 8:38 AM

      Hi,
      You will either have to use a developer license, or the object that makes the deletion of the records will have to be modified to grant permission to those protected tables that you want to delete the records in (and to do this you also need a developer license, your NAV partner should be able to help with this).

      /Olof

  • ASHU
    · Reply

    April 7, 2017 at 5:26 AM

    GREAT! thanks a lot finaly i got ,what i was looking for……………. didn’t tried though if it works you should be paid for this.

  • Barrett Allen
    · Reply

    November 1, 2018 at 3:15 PM

    Hey there Olof!
    Just wanted to let you know that this record deletion tool has come in really handy!
    Also, I find a lot of useful tips on Operations and Inventory topics as well.

    Thanks for all of the knowledge sharing it is very much appreciated!

  • dontomaso
    · Reply

    December 13, 2018 at 3:56 AM

    Has anyone tested this on NAV2017?

    • Olof Simren
      · Reply

      Author
      December 26, 2018 at 5:06 PM

      Yes, I have, it should work fine.

      /Olof

  • Steve
    · Reply

    February 13, 2019 at 2:05 PM

    Great tool. Trying to understand How different is this tool from using RapidStart to delete the records

    • Olof Simren
      · Reply

      Author
      March 1, 2019 at 8:48 AM

      Hi Steve,
      RapidStart is a tool to import data, it has a feature to clear the table that’s being imported. So the applications of the two tools is completely different.

      /Olof

  • Rebecca
    · Reply

    February 13, 2019 at 5:57 PM

    How is it different from RapidStart? Does it work with NAV 2018?

    • Olof Simren
      · Reply

      Author
      March 1, 2019 at 8:50 AM

      Hi Rebecca,
      It should work with NAV 2018. There might be a need to review the tables that’s been coded to be deleted.
      See my reply to Steve related to the difference between this tool and RapidStart.

      /Olof

  • Thomas Vorauer
    · Reply

    June 18, 2019 at 7:43 AM

    Hello!

    Thank your for this tool – just had to adjust few tables but otherwise it works fine 🙂

    I have one question regarding the table relation check – i get an error stating that i need to register the table connection for table MicrosoftGraph.

    Can you help me?

    Thanks in advance!

    Thomas

  • Rick
    · Reply

    November 21, 2019 at 4:34 AM

    Hi Olof,

    I have a question.
    I do not have a developer license and at the moment we are working with NAV 2016.
    I have about 25.000 open sales orders that I need to remove/archive, something I will need to do on a regular basis. I am familiar with Rapidstart and NAV in general.
    How can I remove these sales orders in batch without having to open the card and delete them or send them to the archive one by one (which will take forever).
    Thank you very much for the blog. It has been very useful to me.

    / Rick

  • paul rennison
    · Reply

    February 12, 2020 at 8:18 AM

    I have a question – Do you have any plans to turn this into an extension ? I love this tool and would like to keep using it

Leave a Reply

Your email is safe with us.
Cancel Reply

Subscribe to My Blog via Email

Check Out My Apps in AppSource

My Dynamics NAV Partner

Naviona, LLC

Categories

  • Assembly (3)
  • Development (35)
  • Finance (14)
  • General (28)
  • Inventory (25)
  • Manufacturing (37)
  • Miscellaneous (28)
  • Purchase (10)
  • Sales (11)
  • Warehouse (7)

Tags

.net Add-in AI AppSource Assembly Assembly BOM CAL Capacity Consumption Convergence 2015 EMEA Copilot Costs Customer Development Dimensions Excel Finance General Ledger Inventory Item KCP Dynamics MRP NAV 2013 NAV 2015 NAV 2016 Output Planning Production Production BOM Production Orders Purchase Orders Quality Reports Routing Sales Order Scrap Security Stockkeeping Unit Subcontracting Task List Warehouse Warehouse Put-away Warehouse Receipt Warehouse Shipment Work Center

Recent Posts

  • Quality Management in Business Central Version 28
  • Business Central Configuration Audit using Vibe Coding
  • Copilot in Planning Parameter Worksheet
  • Copilot in Planning Worksheet
  • Copilot Inventory Queries
  • Record Deletion Tool for Business Central in AppSource
  • Reopen Finished Production Orders
  • XML Buffer and CSV Buffer Tables
  • Functionality Improvements in NAV 2017
  • Reversing Production Output and Consumption

Categories

  • Assembly
  • Development
  • Finance
  • General
  • Inventory
  • Manufacturing
  • Miscellaneous
  • Purchase
  • Sales
  • Warehouse

Contact Us

We're currently offline. Send us an email and we'll get back to you, asap.

Send Message

Categories

  • Assembly (3)
  • Development (35)
  • Finance (14)
  • General (28)
  • Inventory (25)
  • Manufacturing (37)
  • Miscellaneous (28)
  • Purchase (10)
  • Sales (11)
  • Warehouse (7)

Tags

.net Add-in AI AppSource Assembly Assembly BOM CAL Capacity Consumption Convergence 2015 EMEA Copilot Costs Customer Development Dimensions Excel Finance General Ledger Inventory Item KCP Dynamics MRP NAV 2013 NAV 2015 NAV 2016 Output Planning Production Production BOM Production Orders Purchase Orders Quality Reports Routing Sales Order Scrap Security Stockkeeping Unit Subcontracting Task List Warehouse Warehouse Put-away Warehouse Receipt Warehouse Shipment Work Center

Recent Posts

  • Quality Management in Business Central Version 28
  • Business Central Configuration Audit using Vibe Coding
  • Copilot in Planning Parameter Worksheet
  • Copilot in Planning Worksheet
  • Copilot Inventory Queries
  • Record Deletion Tool for Business Central in AppSource
  • Reopen Finished Production Orders
  • XML Buffer and CSV Buffer Tables
  • Functionality Improvements in NAV 2017
  • Reversing Production Output and Consumption

Recent Comments

  • Olof on Business Central Configuration Audit using Vibe Coding
  • Andrew Trayfoot on Business Central Configuration Audit using Vibe Coding
  • Barrett Allen on Reopen Finished Production Orders
  • Kateryna on Business Central Configuration Audit using Vibe Coding
  • Takeshi Setoya on Reopen Finished Production Orders
  • Steve on Consignment Inventory
  • Olof Simren on Copilot in Planning Worksheet
  • Omaer Amjad on Copilot in Planning Worksheet

© 2026 · Olof Simren

  • Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ
Prev Next