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)

Getting batch metadata during runtime

(0) ShareShare
ReportReport
Posted on by

Hi there,

does any body know if it is possible to get batch metadata during runtime? There is a batchInfo()-method but most of the info is empty. I was hoping to get the the "Batch" record out of the BatchInfo object but it't empty. The method batchInfo().parmBatchExecute() delivers "No" even if the job is running in batch.

Any idea would be appreciated.

Regards

Nils

*This post is locked for comments

  • 5400 Profile Picture
    7,162 on at

    what type of meta data are you expecting during batch execution.. Could i get more details.  

  • Community Member Profile Picture
    on at

    mostly the RecId of the batch table so that we can observe the status for instance. I expected the method RunBaseBatch.batchInfo().parmBatch() to deliver the RecId but it doesn't.

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 2 on at

    how about parmBatchId()

  • Community Member Profile Picture
    on at

    0 (in batch mode)

    :-)

  • 5400 Profile Picture
    7,162 on at

    BatchHeader::getCurrentBatchTask().RecId

  • Community Member Profile Picture
    on at

    I think this will not work for us. We need the metadata inside the job. Your statement will give me the current task. This could be any task or did i miss something?

  • Verified answer
    Community Member Profile Picture
    on at

    Use the following methods to check in batch and get the current batch record.

    In class of RunBaseBatch

    this.IsInBatch() - checks if in batch

    this.parmCurrentBatch()- this is the record of the currently running class

  • Community Member Profile Picture
    on at

    Hi Bolt,

    thank you i will try that.

  • 5400 Profile Picture
    7,162 on at

    This will give you current batch task which is running

    do you need current bath recid correct.

    inside code is like below..

    session = new xSession();

       select firstonly batch where batch.SessionIdx == session.sessionId() &&

           batch.SessionLoginDateTime == session.loginDateTime() &&

           batch.Status == BatchStatus::Executing;

    Thanks

    Bhaskar

  • Community Member Profile Picture
    on at

    Hi,

    this.parmCurrentBatch() delivers the correct record.

    Thank you.

    Regards Nils

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans