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 AX (Archived)

how to get Actual Start date time & End date time in batch job ax 2009

(0) ShareShare
ReportReport
Posted on by

Dear All,

I need to get Actual start date time and End date time in completed batch job to store in temporary table  

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sohaib Cheema Profile Picture
    48,823 User Group Leader on at
    RE: how to get Actual Start date time & End date time in batch job ax 2009

    yeah you can take it form BatchJobHistory Table

    https://msdn.microsoft.com/en-us/library/cc604388(v=ax.50).aspx

    you may filter this table with status field where status is finished or 4(in ssms)

  • Community Member Profile Picture
    on at
    RE: how to get Actual Start date time & End date time in batch job ax 2009

    hai Sohaib ,

    1.) Is it possible to get last finished job actual date time and end date time ...

    2.) My job names is dynamic get from client so that how to get job start date time and end date time

    thanks for ur reply ...

  • Sohaib Cheema Profile Picture
    48,823 User Group Leader on at
    RE: how to get Actual Start date time & End date time in batch job ax 2009

    yeah on sql server you can write it like following

    select * from batchjobhistory

    order by batchjobhistory.STARTDATETIME desc

    if you want to get only one record you may use max of startdatetime or enddatetime

    if you are writing query on ax, you may write as under

    BatchJobHistory localBatchJobHistory;
        ;
        ttsBegin;
            while select firstOnly10 localBatchJobHistory
                order by localBatchJobHistory.StartDateTime desc
                where localBatchJobHistory.Status == BatchStatus::Finished
            {
                info(strFmt("StartDateTime: %1  EndDateTime:%2",localBatchJobHistory.StartDateTime,localBatchJobHistory.EndDateTime));
            }
        ttsCommit;

    note that I am using keyword firstOnly10  to select only top 10 records to make execute my job fast, as there is lot of data.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans