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, “Zero warehouse records removed within the time limit”, 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 periodic job that deletes on-hand records with only zero values for items that use warehouse management processes.
What you do here
Use this periodic task to make on-hand calculations for items that use warehouse management processes much faster.
Example
For example, BEAT's warehouse MAIN-WH handles 9,000 license plates a week, and InventSum and WHSInventReserve fill with zero rows. BEAT schedules the job nightly at 01:00 with Delete if not updated for this many days set to 7 and Maximum execution time (hours) set to 3, so it stops before the 05:00 shift.
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 on-hand calculations for items that use warehouse management processes slow down because InventSum and WHSInventReserve hold many records with only zero values.
How often
As a recurring batch job outside working hours. Microsoft gives no fixed interval.
Batch settings
Schedule it outside working hours with a Maximum execution time, so it stops and saves its progress before the day starts. It commits about every 100 deletions, so lock escalations can still occur.
What the output shows
Records in InventSum and WHSInventReserve below the Location level whose values are all zero are deleted. If negative physical inventory is allowed, some zero entries can stay, for example a license plate with +1 and -1 of two serial numbers.
Run Warehouse management on-hand cleanup safely and only when the data is no longer needed.
Steps from Microsoft
Go to Inventory management > Periodic tasks > Clean up > Warehouse management on-hand cleanup.
In Delete if not updated for this many days, enter the minimum number of days to wait before an on-hand entry that dropped to zero is deleted. Enter 0 or leave it blank to clean up as soon as possible.
In Maximum execution time (hours), enter how long the job may run before it saves its work and closes. Enter 0 or leave it blank to let it run until it's done.
Set the scope and schedule under Run in the background, at times when system load is lightest and outside working hours, to avoid deadlocks with users.
Afterwards, open the On-hand list with the Quantity <> 0 condition cleared: zero entries below the Location level, such as license plates, no longer appear.
The minimum number of days the job waits before it deletes an on-hand entry that dropped to zero. Enter 0 or leave it blank to clean up as soon as possible.Microsoft Learn
7
Maximum execution time (hours)
The longest the job may run before it saves its work and stops. Enter 0 or leave it blank to let it run until it's done.Microsoft Learn
3
Common errors and fixes
Message
What to do
A deadlock error for the cleanup job or for a user.
The job and a user touched the same record. Schedule it outside working hours, when system load is lightest. Microsoft Learn
Some zero entries stay after the run.
With negative physical inventory allowed, a license plate can show zero with +1 and -1 of two serial numbers; the job can't delete all of those. Microsoft Learn
Test checklist
Count zero on-hand rows below the Location level for one item.
Run the job in a copy with 7 days and 3 hours.
Clear Quantity <> 0 on the On-hand list and check those rows are gone.
Schedule it nightly outside working hours with a Maximum execution time that ends before the first shift.Microsoft advises running it outside working hours to avoid deadlocks with users, and the time limit makes it save its progress and stop.
On the live system, Information technology manager use this page.
Checked in Dynamics 365
Solution architect
5Design impact
Shared or per company
Per company: the job reads and changes only the data of the legal entity you run it in. Checked in Dynamics 365
Can it be undone
Irreversible: Zero records in InventSum and WHSInventReserve below the Location level are deleted for good. Users can no longer see that inventory used to be at a license plate, and as-of-date Physical inventory by inventory dimension reports can be incomplete. Run it first in a copy of production, such as a sandbox refreshed from production, and give the privilege only to the people who own the cleanup.
If you change it later
If all records for a level such as a license plate are deleted, users can no longer see that inventory used to be on hand there. Microsoft Learn
Technical architect
6Technical
Menu item
action:InventCleanupWHSInventSumWithInventDimChecked 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 closed on-hand entriesInventCleanupWHSInventSumProcess
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: Warehouse management on-hand cleanup has no data entity in Data management. Warehouse on-hand is built by opening on-hand journals and warehouse work; nothing is migrated for this job.Checked in Dynamics 365