Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Changing the sequence of started production Jobs from code

(0) ShareShare
ReportReport
Posted on by 38

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

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... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,758 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans