web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Run Inventory on-hand report data clean up in batch

(1) ShareShare
ReportReport
Posted on by 6
Hi,
I got the question from customer and didn't succeed to find something useful in the different resources. The developer confirmed that we need to make development for customer's request, but before that I just want to check maybe I missed something and there is another approach to solve the problem:
Image
"I want to set up a batch job for the Inventory on-hand report data clean up function (Inventory management > Periodic tasks > Clean up > Inventory on-hand report data clean up). I want to delete all data or all data older than 1 day. However, I cannot achieve either.
 
I see 2 possibilities: there is a field to delete data before a specific date and time or I can specify in the criteria which execution time should be deleted. However, both seem to only accept absolute values, while for execution in batch it is of course necessary to specify a relative value. How do I approach this?"
 
 
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    It's not clear what problem you have with running it as a batch. It's supported out of the box, just expand Run in the background fast tab on the dialog and configure it as you like.
     
    Dealing with the time is more complicated. In theory, you could simply use a filter (with something like lessThanDate()) on ExecutionTime field; the problem is date it's neither Date field not a DateTime field; it's a string instead.
     
    If you aren't familiar with filters like (lessThanDate(-1)), you should look at that (e.g. in Advanced filtering and query syntax), because it's often useful. Just note that this applies to query ranges, not to dialog fields.
     
    You could either add an extra field that will contain the same value as ExecutionTime but as a regular date/time value, or add a custom field to the dialog and handle it in an extension of InventOnhandStorageReportCleanUp. I would prefer the custom field; it'd make filtering easy and efficient.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 303 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 122 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans