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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Run a report on a daily basis

(0) ShareShare
ReportReport
Posted on by

Hi,

Hopefully someone can help me? I have a report that I've written that produces results based on todays date. The date parameter is configured via a UIBuilder that populates the date parameter with todays date and works great when run manually by a user. What I've been asked to do is to automate the delivery of the report via email on a daily basis. I set the report to run as a batch thinking it would just work, but for some reason the date parameter is always set to the date that the batch job was created, not todays date. Has anyone got any ideas how to get around this?


Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,988 Super User 2026 Season 1 on at

    Hi Rick

    Take a look at the Inventory closing job. This is using Period codes to determine the date.

  • Community Member Profile Picture
    on at

    Hi Andre,

    Thanks for your reply. I'm still learning AX and I don't quite understand what you mean when you say to look at the Inventory Closing job. Please can you tell me where I can find this job?

    Thanks.

  • André Arnaud de Calavon Profile Picture
    303,988 Super User 2026 Season 1 on at

    Hi Rick,

    Sure; no problem. The periodic option in menu Inventory management, Periodic is called "Closing and adjustment". On this form you can click the button 'Recalculation'. Then you will see the dialog with a period code field which determines the date on the dialog, but also in runtime.

    The class used is called: InventCostClosingRecalc.

  • Community Member Profile Picture
    on at

    Thanks Andre,

    I've had a look at your suggestion, but I think I may not have explained myself properly.

    My report works fine when run manually, the user opens the report, the dates are set in the parameters UI automatically and all the user needs to do is click OK to run the report.

    I was hoping that when I set up a batch to send this report via email, the batch job would honour the date parameters that are set automatically at runtime just as if it had been run manually, but it looks as though the parameters are being set via some other mechanism when run via a batch.

    Strangely though, if I look at the batches task and click the parameters button, I see the parameters dialog box with the correct dates set, but for some reason, when the batch runs, the run date is the date that the batch was created.

    Rick.

  • Verified answer
    Community Member Profile Picture
    on at

    I couldn't figure out how to get AX to use the default dates set in the UI when running the report in a batch. So I used a workaround. I created a Boolean parameter call "run in batch" and looked for this switch in the Data Provider. If the parameter was set to true, I calculated the start and end date for the report in code. If the parameter was false, I used the start and end date provided in the UI. It's a bit "ham fisted" but it works.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans