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

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Inventory Aging Report and Costing version - "As of Date"

(1) ShareShare
ReportReport
Posted on by 236
Dear Members,
 
     Currently, I am running the inventory aging report and the costing version on daily basis manually. I would like to get that one automatically done rather than a person doing it manually. I had achieved scheduling it every day. The problem is my report is running everyday, but the since the date given in "as of date" (for example, say I had given  "16/09/2025"), and It is fetching the values as of today. But the scheduled job, on running tomorrow, it fetches the value as of yesterday(16/09/2025) and not today(17/09/2025).
 
      In simple words, If the batch scheduled date is 17/09/2025, the "As of date" must also take the date as 17/09/2025. If the batch scheduled date running on 18/09/2025, the "As of date " must also be 18/09/2025 and so on.
 
      Is there any solution that is available by default in D365 Finance and operations, that will allow to calculate the inventory aging and the costing version as of the scheduled date it is running ?
 
Kindly help me by providing me your insights in the matter which I have described above and help me to meet my requirement. 
 
Thanks,
Saravanan
 
 
Categories:
I have the same question (0)
  • CA Neeraj Kumar Profile Picture
    1,206 on at
    Inventory Aging Report and Costing version - "As of Date"
    Please clarify once, from which menu path you are running the Costing versions.
  • Suggested answer
    CA Neeraj Kumar Profile Picture
    1,206 on at
    Inventory Aging Report and Costing version - "As of Date"
    Hi @Saravanan,
     
    Please use the Inventory aging report storage report, if you keep the "As of date" blank, it takes current system date.
     
    Help text
    As of date
    The date that the values of the report are based on. System will use the current system date to run the report if you leave it as empty.
     
     
    Regards,
    Neeraj Kumar
  • Suggested answer
    CA Vijay Krishna Profile Picture
    29 on at
    Inventory Aging Report and Costing version - "As of Date"
    In standard Dynamics 365 Finance and Operations, the Inventory aging and Costing version reports allow you to schedule batch jobs. However, the “As of date” parameter is static when you set it. That means if you enter 16/09/2025, the system will keep re-using that date for every scheduled run, regardless of the actual run date.
     
    As there is no built-in Option in D-365 F&O to make the as of date automatically equally to the batch run date, the date is treated as fixed param not as variable.
     
    If the business requirement is strictly to have the As of date = the scheduled job run date, a small X++ customization is the cleanest option. Many customers implement this, since aging and costing reports are sensitive to date.
     
    It can be achieved in 2 ways X++ Customization or Power Automate/Azure Function
     
    Below is the Sample X++ Code ( It may change based on your company Classes and Controller Configurations)
     
    [ExtensionOf(classStr(InventAgingContract))] // <- confirm the class name in your AOT
    final class InventAgingContract_Ext
    {
        NoYesId useRunDate;
        // Visible on the dialog automatically
        [DataMemberAttribute,
         SysOperationLabel(literalStr("Use run date as As of date")),
         SysOperationHelpText(literalStr("If Yes, the report will use the batch execution date for the As of date."))]
        public NoYesId parmUseRunDate(NoYesId _useRunDate = useRunDate)
        {
            useRunDate = _useRunDate;
            return useRunDate;
        }
    }
     
    I intercept just before the report runs in batch and replace the As of date when the switch is ON.
     
    [ExtensionOf(classStr(InventAgingController))] // <- confirm controller class name
    final class InventAgingController_Ext
    {
        protected void preRunModifyContract()
        {
            // Always call base to keep standard behavior
            next preRunModifyContract();
            // Get the RDP contract that actually holds parameters
            SrsReportRunController      baseCtrl  = this;
            SrsReportDataContract       rptDC     = baseCtrl.parmReportContract();
            InventAgingContract         contract  = rptDC ? (rptDC.parmRdpContract() as InventAgingContract) : null;
            if (contract && contract.parmUseRunDate() == NoYes::Yes)
            {
                // Choose which 'today' you want. For most customers:
                // - systemDateGet(): uses the session date; batch typically runs with true current date.
                // If you must force calendar date in a specific TZ, convert from utcNow().
                date today = systemDateGet();
                contract.parmAsOfDate(today);
            }
        }
    }
     
     
    Assumptions: Batch Server Running Time Zone and Company Time Zone are same.
     
    There is one more approach, you can keep the param as CYTD which included all the transcations in future as well, but it may create lots of issues.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
DAnny3211 Profile Picture

DAnny3211 214

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 129 Super User 2025 Season 2

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 123

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans