Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Changing the sequence of started production Jobs from code

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans