Delete production order

j.marseloj.marselo Member Posts: 102
i have a situation of repeating production order no., but it will only happen to a previously existed Finished prod. order.
my plan is to allow deletion of finished produciton order.
to achieve this, i will modify tables:
5405 - Production Order
5406 - Prod. Order Line
5407 - Prod. Order Component
5409 - Prod. Order Routing Line
5410 - Prod. Order Capacity Need

these tables contains code lines to restrict the deletion.
i plan to modify a bit to enable me to delete a finished production order and all related tables.

here what we have in the those tables.

in table 5405:
OnDelete()
----------
IF Status IN [Status::Released,Status::Finished] THEN BEGIN
  ItemLedgEntry.SETCURRENTKEY("Prod. Order No.");
  ItemLedgEntry.SETRANGE("Prod. Order No.","No.");
  IF ItemLedgEntry.FIND('-') THEN
    ERROR(
      Text000,
      Status,TABLECAPTION,"No.",ItemLedgEntry.TABLECAPTION);
...
I will change:
IF Status = Status::Released THEN BEGIN
//the rest are the same
...

on table 5406, 5407, 5409:
OnDelete()
----------
IF Status = Status::Finished THEN
  ERROR(Text006,Status,TABLECAPTION)
...
I will change:
{IF Status = Status::Finished THEN
  ERROR(Text006,Status,TABLECAPTION)
}
//just put in bracket
...


In evaluating the effects:
I consider, we have the record in the Item Ledger Entry anyway, in case we need to see the history.
We only can not see the finished prod. order appear when Navigate the entries.

Anyone here has ideas?
Compare to enable renaming the field:"No." - WHICH ONE is easier to accomplish?

Any comments are highly appreciated.

Thank you.
Kind regards, Joe Marselo | see my NAV blog joemarselo.wordpress.com | twitter @joemarselo

Comments

  • cernstcernst Member Posts: 280
    I don't think it's a good idea to delete the finished prod.orders. The inventory batch uses the field "Completly invoiced" in tabel 5406, not sure if that's the case in 4.0 sp2 though.

    Anyway you must not delete prod.orders where the cost haven't been adjusted.
    The deleting of record might cause problems later on in upgrades etc. that one can't know of now.

    If reusing prod.order no.'s is something you must do then you instead could change so that when you change status to finished the finished prod.order is assigned another no. then the released on, then you can reuse prod.order no.'s but the finished prod.order has it's on no. serie. So no deleting is needed.
    _____________________
    NAV Freelance Consultant
  • j.marseloj.marselo Member Posts: 102
    Noname,
    If I sum up all points you stated about deleting finished production order, I can not see a real serious effects.
    In short, you mention about "Completly invoiced" field in tabel 5406 but you are not sure, the cost of finished production order may be not adjusted yet - where I'm doubtful of this , and a not-known possible problem on upgrade ...

    So, compare to the effort of changing "No." field in Production Order table (for Status::Finished), which one is easier and simpler to accomplish?

    Thank you for the comments.
    Kind regards, Joe Marselo | see my NAV blog joemarselo.wordpress.com | twitter @joemarselo
  • j.marseloj.marselo Member Posts: 102
    Concluding this, enable renaming the Finished Production Order No. is a lot simpler.
    Only need to deactivate the line in OnRename() trigger in Prod. Order table.
    Kind regards, Joe Marselo | see my NAV blog joemarselo.wordpress.com | twitter @joemarselo
  • j.marseloj.marselo Member Posts: 102
    thanx
    Kind regards, Joe Marselo | see my NAV blog joemarselo.wordpress.com | twitter @joemarselo
Sign In or Register to comment.