Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

how to run scheduled batch job in dynamics ax

(0) ShareShare
ReportReport
Posted on by

i have created a method in a class to send the file to ftp server when ever the field is updated

it is working fine

now i want to run this class with the help of batch job 

batch to be run every day at 5:30 pm

  • Suggested answer
    Martin Dráb Profile Picture
    231,927 Most Valuable Professional on at
    RE: how to run scheduled batch job in dynamics ax

    Look at the dialog (I took the image from the tutorial mentioned above):

    Notice the Batch tab. There you can enable batch processing and set up recurrence.

    There are many ways how you can get the data if you want; I even already mentioned one of them in my first reply. If you want to use ModifiedDateTime, you can, for example, save the date of the last execution and when your process runs again, you'll take all data modified after this saved time.

  • Community Member Profile Picture
    on at
    RE: how to run scheduled batch job in dynamics ax

    i dont want to ignore that the method run for changes done from  previous day 6:30 pm to present day 6:29 pm

    you have any other code that can make easy to fetch the changes data

  • Community Member Profile Picture
    on at
    RE: how to run scheduled batch job in dynamics ax

    i went through the post.

    i have a question how i will run it automatically in schedule time

  • Martin Dráb Profile Picture
    231,927 Most Valuable Professional on at
    RE: how to run scheduled batch job in dynamics ax

    By the way, are you sure that you want to ignore changes done between 5:30 pm and midnight?

  • Martin Dráb Profile Picture
    231,927 Most Valuable Professional on at
    RE: how to run scheduled batch job in dynamics ax

    Good, then see the last paragraph of my previous reply. Ask a concrete question if you get stuck somewhere.

  • Community Member Profile Picture
    on at
    RE: how to run scheduled batch job in dynamics ax

    The method logic is to send those rows whose date of modifieddatetime

    inventTable.modifiedDateTime >= datetobeginUtcDateTime(today(), DateTimeUtil::getUserPreferredTimeZone()) &&

    inventTable.modifiedDateTime <= datetoendUtcDateTime(today(), DateTimeUtil::getUserPreferredTimeZone())

    i just want to run this class using batch job

  • Suggested answer
    Martin Dráb Profile Picture
    231,927 Most Valuable Professional on at
    RE: how to run scheduled batch job in dynamics ax

    You must be able to identify data to be sent. For example, when a record is updated with the field modified (don't use modifiedField(), because it happens before saving and saving doesn't have to occur), you'll write a record to table.

    Then you'll implement a batch class processing the data .For example, the batch will read data from a table and either delete processed records, or change their status (so they're not processed again in the next run).

    You can either use SysOperation framework (which is recommended) or RunBaseBatch framework. Check out SysOperation introduction, for instance.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,265 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,927 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans