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

Call class from job passing arguments to dialog without showing dialog

(0) ShareShare
ReportReport
Posted on by 927

Hi, 

How can I call a class from a Job and  then pass arguments to dialog of that class without showing the dialog but needed for setting of local variables and executing running method of that class?

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,152 Most Valuable Professional on at

    What class are you talking about? Maybe a class inheriting from RunBase?

    If you don't want to use a dialog, your goal shouldn't be "pass arguments to dialog". You should skip the GUI completely and set values directly. The usually approach in AX 2009 is using parm* method for this purpose. For example:

    MyClass myClass = MyClass::construct();
    myClass.parmAccountNum('123456');
    myClass.parmQty(42);
    myClass.run();
    x

  • Glenn Lissone Profile Picture
    927 on at

    For testing purposes I don’t want to modify the original class and want to run the class via a job if it’s possible.

  • Martin Dráb Profile Picture
    239,152 Most Valuable Professional on at

    It's impossible to say what's possible unless you explain what class you're talking about. You may have absolutely any code in the class, and there can't be an universal answer for any code that can be written.

    Running code in a job is possible - that's the only thing that a job is for. Of course, it's not for production use - there you need classes, menu items and such things.

  • Glenn Lissone Profile Picture
    927 on at

    for example call Tutorial_RunbaseBatch via job without modifying the original class and pass arguments (custAccount, date) and run.

  • Suggested answer
    Martin Dráb Profile Picture
    239,152 Most Valuable Professional on at

    All right, so you're indeed talking about a class inheriting from RunBase.

    Unfortunately I don't know how Tutorial_RunbaseBatch is implemeted. If it doesn't have methods that allow changing the state from outside, you can add the logic without changing the class by creating a child class.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 681

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 448 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 218 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans