HowTo #023

How to delete non-used entries to avoid unnecessary database growth?

Use Case:

You work in the IT department and want to clean up unused entries. The reason for the growth of the database is that some tables are assigned to activities, logging and archiving. It can have an impact on performance but also can make it more difficult to find data. However, you do not want to check and delete the data manually, as this is very time-consuming. Therefore, you are looking for an automation option and have come across the possibilities of the retention policy.

HowTo: Use Retention Policies to avoid unnecessary database growth

01

Go to Retention Policies.

02

Press + New in the top menu to create a new Retention Policy.

03

In the FastTab General press on the three dots in the Table Id field.

04

In the look up Objects you see the ID and Object Caption for which a Retention Policy can be created.

In our first example we will select ID: 474Object Caption: Job Queue Log Entry and confirm with OK.

05

In the FastTab Retention Policy we enter the following:

  • Retention Period: 28 DAYS
  • Enabled: active
  • Apply to all records: active
06

We can close that created Retention Policy. In the background, from today on, every 28 days all Job Queue Log Entries will be deleted.

07

For our second example we again press + New but in the Table, we now choose ID 5107 / Sales Header Archive and confirm with OK.

08

In the FastTab Retention Policy we disable Apply to all records as we do not want to delete all Sales Headers in the archive. Based on rules we want to keep some data.

09

A new FastTab Record Retention Policy is now available. Press on the empty line of the column Table Filter Text.

10

The Sales Header Archive Filters window opens. Here we press + Filter and enter Source Doc. Exists. Afterwards we enter Yes in the filter and confirm with OK.

11

In the column Retention Period, we enter: NEVER DELETE.

12

We enter a second Table Filter Text line. In the look up for Sales Header Archive Filters we choose Interaction Exists, set the filter to Yes, and confirm with OK.

13

We enter NEVER DELETE for the Retention Period.

Extra tip: You also have the possibility to enable Keep Last Document Version to decrease entries but keep the last version of the sales document. 
14

After creating a Retention Policy in the background, a Job queue is automatically created. It checks if there are retention policies and if there is data which needs to be deleted.

Conclusion

Now we can create retention policies and keep our database clean.

Because this is a standard Business Central functionality, there is a lot of information available from Microsoft. For example, have a look at the following video:

Use retention policies to avoid unnecessary database growth – YouTube

Leave a Reply

    Feature of the Week

    No ads: A new HowTo for acadon Software every week.

    Wood be nice to have

    You have an idea for a new function or feature?

    Only for acadon customers

    OnRoute App
    Try our new OnRoute app free for 30 days!
    timber tree
    timber tree
    acadon logo
    The acadon AG has 40 years of experience in ERP software for the wood industry. As business optimizers, we develop tailored solutions and strategies for your company.
    © 2024 acadon AG. All rights reserved.

    Webinar registration

    Request free demo now!