Skip to main content

Scheduled Task: Delete Old Records

Explains the daily Delete Old Records task in Encompass: why old records, field audit history and expired items get purged per retention settings, and why long runtimes are normal. v26.07+.

B
Written by Bailey Naas-Thornton

Minimum Version Required: 26.07

Steps

What the Delete Old Records Scheduled Task Does

Delete Old Records is an automatic background maintenance task that runs once a day. You may notice it listed on the Scheduled Tasks screen, but it does not require any action from you - it keeps the system clean and running efficiently by removing data that is no longer needed. Each run performs the following:

  1. Purges records from any table that has a retention period configured, removing rows older than that table's Delete Records After Days setting.
    ​
    ​

  2. Trims the Field Audit Trail (the change history kept for individual fields) down to each field's Audit Retention Days setting, so history doesn't build up indefinitely.
    ​
    ​

  3. Removes expired system items that are no longer needed, including expired QuickLinks, expired Documents, and old entries in the internal log used to track recently deleted records.
    ​
    ​

  4. Cleans up leftover internal tables (temporary and old backup tables) that Encompass creates during upgrades and reporting, once they are no longer needed.
    ​
    ​

  5. Removes any custom scheduled tasks that reference an API command that no longer exists.
    ​
    ​

  6. Runs the same kind of cleanup inside specific Encompass modules, purging outdated operational data unique to each - for example, completed Load Sheets and pallet records in WMS, old EDI exchange files, unused DSDLink shopping cart records, and stale chat messages or mobile device logs in CRM.
    ​
    ​

  7. Performs routine database table maintenance (optimizing and analyzing tables) to help keep the system responsive.

Fields And Definitions

  • Delete Records After Days - Found on the Tables table. Sets how many days a table's records are kept, based on each record's Time Updated date, before Delete Old Records removes them. Leave this blank to keep a table's records indefinitely.
    ​
    ​

  • Audit Retention Days - Found on the TableFields table. Sets how many days a field's change history is kept in the Field Audit Trail before it is purged. Defaults to 30 days when not set.

Best Practices

  • This task runs automatically once a day - seeing it in the Scheduled Tasks list is expected and does not mean anything is wrong.
    ​
    ​

  • On databases with a lot of data, Delete Old Records can take a while to complete. A long runtime by itself is not a failure.
    ​
    ​

  • This scheduled task is non-critical, failures can happen when data builds up, but the task will catch up on the next run.

Did this answer your question?