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

Notifications

Announcements

No record found.

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

I have the same question (0)
  • 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,438 User Group Leader 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans