Skip to main content



No record found.

Microsoft Dynamics AX forum

Changing the sequence of started production Jobs from code

Posted on by 20

Hi all,

I am currently creating a form which should make it possible to insert operations (ProdRoutes / Jobs) into running productions. Logic is a little bit complex, but basically a new record is inserted in ProdRoute table behind the last finished one, OprNum & OprNumNext of all following ProdRoute records (for BOM aswell) are adapted (incremented) and production is rescheduled and reestimated. This is working fine for Productions where started Jobs are also 'completed' (JobStatus).

But now it's getting a little bit tricky. In case a job has the status 'stopped' the new job should be inserted 'in front of it', while acquisitions and status of 'stopped' job should be kept.

Case example: A workman starts a job, but notices that the product is not in the condition intended for this job. He stops the job. A foreman then inserts a new job into the system, that has to be completed beforehand. When the new job is reported complete, the workman can start his job again.

Current functionality/Incrementing OprNum has no effect here, since JobId is the primary index of JmgJobTable and the stopped Job doesn't get an new JobId on reschedule. As a result, the new created Job is inserted behind the stopped one, even though it has a lower OprNum. As far as I can tell, the only way to get the desired functionality would be to reschedule the job aswell and change the RefId of all related records to the new JobId.

Since I'm still new in AX, I wanted to ask if anyone has implemented something similar and if so, how, or if anyone knows a better solution, as this approach does not seem particularly effective to me.

Best regards

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans