BeyondERP.Newsletter
Menu

Setup step on the Batch job history clean-up (custom). page · System administration

Run a targeted batch job history clean-up

Delete only the history entries of selected jobs, users, companies or statuses.

Business process
Administer system features
Menu item
action:BatchJobHistoryCleanup
Setup steps
1 on this page
Show what matters for
SETUP GUIDEHow to set it up8 sections. Choose a role to highlight what matters to you.
Everyone

1What it is and why

What it isA periodic job that deletes only the batch job history entries that match filters such as status, job description, company or user.
What you do hereUse this periodic task only when specific history entries must be deleted.
ExampleFor example, one recurring BEAT job writes thousands of history entries a day; the administrator runs the custom clean-up filtered on that job's description, with Records to delete in a transaction set to 10 because the job keeps a large information log.
Batch job history clean-up (custom). page in Dynamics 365
The page in Dynamics 365. page title tab to open what to set or check
Functional consultant · Solution architect

2Where it fits

Business processAdminister system features
Menu pathSystem administration › Periodic tasks › Batch job history clean-up (custom).
Set up firstBatch jobs (find the noisy job) Microsoft Learn
Used next byBatch job history clean-up (standard) Microsoft Learn
Related pagesBatch job history clean-up. Microsoft Learn
In this process Schedule the batch job history clean-up · Schedule the batch job table clean-up
End user · Functional consultant

3How to do it

About the examples: Examples and screenshots in this guide use BEAT, a demo company in a Dynamics 365 test environment. Use your own company's codes and values instead of copying them.

When to run it

When to run itOnly when specific batch job history entries must be deleted, for example the history of one noisy recurring job.
How oftenOn demand, when a targeted cleanup is needed; use the standard Batch job history clean-up for routine removal.
Batch settingsRun it in the background outside business hours, one custom cleanup at a time.
What the output showsBatch job history that matches your filter and is older than the history limit is deleted; everything else stays. If too much was deleted, the filter under Records to include was too broad.

Source: Microsoft Learn

Setup steps on this page

Run a targeted batch job history clean-up

Delete only the history entries of selected jobs, users, companies or statuses.

Steps from Microsoft

  1. Go to System administration > Periodic tasks > Batch job history clean-up (custom) (the menu label ends with a period).
  2. In History limit (days), enter how many days of the matching history to keep.
  3. In Records to delete in a transaction, enter a value from 10 to 100. Use a smaller number when the jobs carry large parameters or information logs, so other jobs aren't blocked.
  4. Under Records to include, filter on status, job description, company or user, and add other fields with Filter.
  5. When you need several cleanups with different criteria, run them one after another, never at the same time.
  6. Afterwards, confirm that only history matching your filter was removed and that other jobs' history is untouched.

Source: Microsoft Learn

Fields on the page

FieldWhat it meansExample
History limit (days)How many days of batch job history to keep.Microsoft Learn 30
Records to delete in a transactionHow many records are deleted per database transaction; use a smaller number for large volumes.Microsoft Learn 10
Records to includeFilter on status, job description, company or user; add other criteria with Filter.Microsoft Learn

Common errors and fixes

MessageWhat to do
Other batch jobs are blocked while the clean-up runsLower Records to delete in a transaction, so the deletion runs in smaller pieces. Microsoft Learn
The clean-up ends with a database deadlockRun custom clean-ups with different criteria one after another, not at the same time. Microsoft Learn

Test checklist

  1. History of the filtered jobs older than the limit is gone.
  2. History of other jobs is still there.
  3. No deadlock or blocking was reported while the cleanup ran.

Source: Microsoft Learn

Functional consultant

4Setup decisions

Setup stepRecommended value and whyDecision, common mistake and test
Run a targeted batch job history clean-upUse it only when specific entries must go, with a filter under Records to include and 10 to 100 records per transactionLearn: the custom version is for specific entries; smaller transactions avoid blocking other jobs, and runs with different criteria must follow one another.How many records are deleted per transaction?Leaving Records to include empty, which turns the custom run into a slower version of the standard clean-up.Test: Only the filtered history is deleted

Feature management and licence

Licence or add-inNo Feature management feature needs to be turned on for this page.

Microsoft Learn

Solution architect

5Design impact

Shared or per companyShared table, filtered run: the batch job history table has no company key, so the run deletes matching history across companies unless you filter on company. Microsoft data model
Can it be undoneNo: Deleted history can't be restored.
If you change it laterRun several custom cleanups one after another, never at the same time, to avoid deadlocks. Microsoft Learn
Technical architect

6Technical

Menu itemaction:BatchJobHistoryCleanup Checked in Dynamics 365
Developer

7Developer

Open it by URLhttps://<your-environment>/?mi=action:BatchJobHistoryCleanup
Data migrationLoad order: Batch job history clean-up (custom) has no data entity in Data management, so it can't be loaded from a file or a configuration template. It is a periodic job; run it again in each environment when needed.Checked in Dynamics 365
Everyone

8Sources

To cite this step: SA-JOB-825, Run a targeted batch job history clean-up. Beyond ERP Atlas Hub, 2026-11-11. https://www.beyonderp.cloud/atlas/step/SA-JOB-825