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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX 2009: Running a job schedule programmatically for a production

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to create a job schedule for a production with x++ code.

This works fine with the following statement:

    ProdParmScheduling  prodParmSched;
    ProdMultiSchedulingJob  ProdMultiSchedulingJob;
    ;

    prodParmSched.ProdId = _prodTable.ProdId;
    _prodTable.status().runJobScheduling(prodParmSched);

 

But I want to use the last default-parameters the users used (ProdParmScheduling).

I don´t want to show a dialog.

 

The last used ProdParmScheduling is in the sysLastValue in the classdeclaration of cls\ProdMultiScheduling:

    ProdParmScheduling      standardParmScheduling;

    #DEFINE.CurrentVersion(7)
    #LOCALMACRO.CurrentList
        standardParmScheduling
    #ENDMACRO

 

Have someone an idea how I can get the last used ProdParmScheduling - record?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    OK. Thats the way I solved it:

       ProdMultiSchedulingJob  prodMultiSchedulingJob;

       ProdParmScheduling      prodParmScheduling;

       ;

           prodParmScheduling      = prodParmScheduling::findLast(_prodTable.ProdId, ProdSchedMethod::OperationScheduling);

           prodMultiSchedulingJob  = ProdMultiScheduling::construct(ProdSchedMethod::JobScheduling);

           RunBaseMultiParm::initParm(prodMultiSchedulingJob); // to get ProdParmScheduling from sysLastValue (user specific standard parameters)

           prodMultiSchedulingJob.insert(_prodTable, prodParmScheduling);

           prodMultiSchedulingJob.run();

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans