Version 10.0.49: the menu item, form, table and security, the page.
Recommended values
Based on Microsoft's documentation. A sound starting point to adjust to your own business requirements.
Tests
A ready-to-run test, “Delete purchase order history up to a date”, to confirm this setup in your own test environment.
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 is
A cleanup job that permanently deletes purchase order history records created up to the date you enter in Created until. The dialog has no other selection.
What you do here
Use it to reduce stored purchase order history once the business has agreed how long that history must be kept. Treat it like the other cleanup routines: run it only after the business confirms the data is no longer required, and test it in a test environment first.
Example
For example, BEAT must keep purchase order history for 7 years. In March 2027 the IT manager enters Created until 2019-12-31 and runs the job in a copy of production, checks orders such as PO-000412 from 2019 and PO-003118 from 2024, and only then runs it in production.
The page in Dynamics 365. page title tab to open what to set or check
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 it
When old purchase order history is no longer needed for audits or vendor questions and the business has agreed the retention period.
How often
On demand, for example once a year after the retention period is confirmed.
Batch settings
Run it in the background outside business hours, because one run can process a large number of history records.
What the output shows
Purchase order history created up to the Created until date is deleted for good.
Purchase order history created up to this date is deleted. It is the only parameter of the job.Checked in Dynamics 365
2019-12-31
Common errors and fixes
Message
What to do
History that auditors still need is gone after the run.
The Created until date was too recent. Deleted history can't be restored; agree the retention period first and test the date in a test environment. Microsoft Learn
Test checklist
In a test environment, pick PO-000412 created in 2019 and PO-003118 created in 2024 and note how much history each shows.
Run the job with Created until 2019-12-31.
Open both orders again.
Check that PO-000412 shows 0 history records before 2020 and that PO-003118 shows the same history as before.
Run it with a Created until date that keeps the full retention period agreed with finance and audit, after a test run in a test environment.The job has only one parameter, so the date alone decides what is deleted, and deleted history can't be restored.
On the live system, only the Information technology manager role can run this page.
Checked in Dynamics 365
Solution architect
5Design impact
Shared or per company
Per company: it deletes purchase order history of the legal entity you run it in. Every history record up to the Created until date is in scope. Checked in Dynamics 365
Can it be undone
Irreversible: Deleted purchase order history can't be restored.
If you change it later
Old purchase order history is deleted for good. As with every cleanup routine, run it only after the business confirms the data is no longer required, and test it in a test environment first. Microsoft Learn
Technical architect
6Technical
Menu item
action:PurchOrderHistoryCleanUpChecked in Dynamics 365
Form
SysOperationTemplateFormChecked in Dynamics 365
Who can open it
1 security role. Select a role to see its duties and privileges.
DutyMaintain system settingsSysServerSettingsMaintain
PrivilegeClean up purchase order historyPurchOrderHistoryCleanUpProcess
Roles worked out from Microsoft's standard security setup and checked in a working Dynamics 365 system (version 10.0.49)
Roles to set it up and use it
To use itInformation technology manager SysServerITManagerGive people one of these roles. On this system, 1 role can run this page.Checked in Dynamics 365
Load order: Purchase order history cleanup has no data entity in Data management. It deletes history and holds no data of its own. Run it in the new system only after go-live, once the retention period is agreed.Checked in Dynamics 365