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