//IF Status = Status::Released THEN
// IF ProdOrder.GET(Status::Finished,"No.") THEN
// ERROR(Text007,Status,TABLENAME,ProdOrder."No.",ProdOrder.Status);
In form 99000867 Finished Production Order add new item Change Status in button Prod. Order with properties:
Action = RunObject
RunObject = Codeunit Prod. Order Status Management
In form 99000882 Change Status on Prod. Order in function Set change code to:
IF ProdOrder.Status > ProdOrder.Status::Simulated THEN
NewStatus := ProdOrder.Status + 1
//new+
ELSE IF ProdOrder.Status = ProdOrder.Status::Finished THEN
NewStatus := NewStatus::Released
//new-
ELSE
NewStatus := NewStatus::"Firm Planned";
Stamen Delikostov
Navision Solution Developer
Intelligent Systems Bulgaria
Although, I have some considerations:
is there no "catch" to consider, if you change status from finished back to released ?
Isn't there some posting done, when you originally change status from
released to finished ?
I've looked a bit...the core is probably in the CU5407 Prod. Order Status Management, trigger ChangeStatusOnProdOrder.
Question is : do you want simply change the status to have the opportunity to post extra costs (raw mat, capacities ...) or do you want to make a complete reversing of the PO with cancelling all the already posted costs ?
If it is a simple change of the status, work as s.delikostov explains (you have certainly to comment code in all related tables to Prod. Order like Lines, Routing Lines ...).
If you want to make a complete "rollback" of the prod. order : hard job to do, you need to make a function that makes all the opposite entries (Warning if the costs are adjusted also ...)
Comments
In table 5405 Production Order remove code:
In form 99000867 Finished Production Order add new item Change Status in button Prod. Order with properties:
Action = RunObject
RunObject = Codeunit Prod. Order Status Management
In form 99000882 Change Status on Prod. Order in function Set change code to:
Navision Solution Developer
Intelligent Systems Bulgaria
Although, I have some considerations:
is there no "catch" to consider, if you change status from finished back to released ?
Isn't there some posting done, when you originally change status from
released to finished ?
I've looked a bit...the core is probably in the CU5407 Prod. Order Status Management, trigger ChangeStatusOnProdOrder.
If it is a simple change of the status, work as s.delikostov explains (you have certainly to comment code in all related tables to Prod. Order like Lines, Routing Lines ...).
If you want to make a complete "rollback" of the prod. order : hard job to do, you need to make a function that makes all the opposite entries (Warning if the costs are adjusted also ...)
entries (consumption).
Could this be problem ?