BeyondERP.Newsletter
Menu

Setup step on the Warehouse management on-hand cleanup page · Inventory management

Delete zero warehouse on-hand records

Run Warehouse management on-hand cleanup safely and only when the data is no longer needed.

Used by
Information technology manager
Business process
Manage data
Menu item
action:InventCleanupWHSInventSumWithInventDim
Setup steps
1 on this page

How this guide was checked

Checked in Dynamics 365
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 isA periodic job that deletes on-hand records with only zero values for items that use warehouse management processes.
What you do hereUse this periodic task to make on-hand calculations for items that use warehouse management processes much faster.
ExampleFor 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.
Warehouse management on-hand cleanup 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 processManage data
Menu pathInventory management › Periodic tasks › Clean up › Warehouse management on-hand cleanup
Set up firstWarehouses Microsoft Learn
Used next byOn-hand list Microsoft Learn
Related pagesPhysical inventory by inventory dimension Microsoft Learn
In this process Delete closed on-hand entries for tracked items · Aggregate zero on-hand rows
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 itWhen on-hand calculations for items that use warehouse management processes slow down because InventSum and WHSInventReserve hold many records with only zero values.
How oftenAs a recurring batch job outside working hours. Microsoft gives no fixed interval.
Batch settingsSchedule 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 showsRecords 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.

Source: Microsoft Learn

Setup steps on this page

Delete zero warehouse on-hand records

Run Warehouse management on-hand cleanup safely and only when the data is no longer needed.

Steps from Microsoft

  1. Go to Inventory management > Periodic tasks > Clean up > Warehouse management on-hand cleanup.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Source: Microsoft Learn

Fields on the page

FieldWhat it meansExample
Delete if not updated for this many daysThe 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

MessageWhat 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

  1. Count zero on-hand rows below the Location level for one item.
  2. Run the job in a copy with 7 days and 3 hours.
  3. Clear Quantity <> 0 on the On-hand list and check those rows are gone.
  4. Check that non-zero on-hand is unchanged.

Source: Microsoft Learn

Functional consultant

4Setup decisions

Setup stepRecommended value and whyDecision, common mistake and test
Delete zero warehouse on-hand recordsSchedule 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.When should the warehouse on-hand cleanup run?Running it during the day, when users working on the same records get deadlock errors.Test: Zero warehouse records removed within the time limit

Feature management and licence

Licence or add-inOn the live system, Information technology manager use this page.

Checked in Dynamics 365

Solution architect

5Design impact

Shared or per companyPer company: the job reads and changes only the data of the legal entity you run it in. Checked in Dynamics 365
Can it be undoneIrreversible: 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 laterIf 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 itemaction:InventCleanupWHSInventSumWithInventDim Checked in Dynamics 365
FormSysOperationTemplateForm Checked in Dynamics 365
Who can open it

1 security role. Select a role to see its duties and privileges.

  • RoleInformation technology managerSysServerITManager
    • 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 itTo use itInformation technology manager SysServerITManagerGive people one of these roles. On this system, 1 role can run this page.Checked in Dynamics 365
Developer

7Developer

Open it by URLhttps://<your-environment>/?mi=action:InventCleanupWHSInventSumWithInventDim
Data migrationLoad 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
Everyone

8Sources

To cite this step: IM-JOBA-130, Delete zero warehouse on-hand records. Beyond ERP Atlas Hub. https://www.beyonderp.cloud/atlas/step/IM-JOBA-130