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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Call the RunBaseBatch class with the selected record on form. Ax2012

(0) ShareShare
ReportReport
Posted on by 152

Hello all,

I have a form and a button, that on this button i want to run a runbasebatch class with the selected record on form.(not multiselect)

For example, if i have selected on form a record from purchtable, when i click this button which is the runbasebatch class, i want to filter all the items related to purchline of this purchid selected on grid.

Can someone help me to pass the record selected on runbasebatch class? I am using microsoft dynamics ax2012

Thanks in advance.

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Paula,

    You can retrieve the record in the main method of the class itself.

    static void main(Args args)
    {
        PurchTable purchTable;
        
        if (args.record().TableId == tableNum(PurchTable))
        {
            purchTable = args.record();
        }
    }

    You can then write a parm method in your class to either pass the purchTable buffer or PurchId, depending on how the class is designed.

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    Are you trying run this class as a batch job or will you just use this class as a normal class.

    If you runing it as a batch job then you need use pack/unpack

    community.dynamics.com/.../914280

    If not then you can set button's datasource property and at main method use args for getting caller record.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans