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 150

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.

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: Call the RunBaseBatch class with the selected record on form. Ax2012

    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.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Call the RunBaseBatch class with the selected record on form. Ax2012

    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.

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,238 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans