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...
Suggested answer

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

(1) ShareShare
ReportReport
Posted on by 238
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)
  • André Arnaud de Calavon Profile Picture
    298,044 Super User 2025 Season 2 on at
    Inventory Aging Report and Costing version - "As of Date"
    , can you tell us your background? The T symbol is working for Today, but a calculation with +1 or -1 is not supported. Have you created your reply with the help of AI and forgotten to validate the outcome? Also note that when entering T, it will directly replace the date and will store the date in the parameters for the batch. It is not a dynamic value taken at the time of batch execution.
     
    As mentioned earlier, a customization is required to override the date when executing the batch job.

     
  • Suggested answer
    Sahan Hasitha Profile Picture
    1,026 on at
    Inventory Aging Report and Costing version - "As of Date"
    hi
    In standard Dynamics 365 Finance and Operations, the Inventory aging report and Costing version reports do not automatically roll the “As of date” forward when you schedule them in batch. By default, the report will always use the fixed date entered when you first set up the job. To achieve your requirement, you need to leverage the dynamic date functions that Microsoft provides for batch jobs. Instead of typing a fixed date, you can enter a relative date such as t (today), t-1 (yesterday), or t+1 (tomorrow) in the “As of date” field when configuring the batch. This way, each time the job runs, it will calculate the “As of date” dynamically based on the system date of execution. If the standard report you are using does not expose the dynamic date option directly, you can work with your system administrator to adjust the query range control in the batch setup, or create a small customization that replaces the hard-coded date with SystemDateGet(). Using this approach ensures that your scheduled Inventory Aging and Costing reports always run “as of” the date of the batch execution without requiring manual adjustments.
  • CA Neeraj Kumar Profile Picture
    1,341 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,341 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
    67 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
Sahan Hasitha Profile Picture

Sahan Hasitha 152

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 129 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans