Purchase Order

I have to modify Navision code to not delete a completed Purchase order. I have gathered that the code to do this is in codeunit 90 but do I have to save all the other documents data around the purchase order. Stuff like Document Dimension information. I think I do since the user has to be able to over receive on a order and post on it again. How safe to Navision as a whole is it to comment all the deletes out of Codeunit 90 in the OnRun() method. From the second time you encounter the line “DocDim.DELETEALL;” Or is there a saver place to stop the deletion of the purchase order that would not influence Navision that greatly? Your help would be much appreciated since my brain has turned to liquid since I have been stepping through codeunits the whole afternoon.

There is a Flag that gets set when the Purchase Order is complete (EverythingInvoiced). If you use this, you will need to change less code and everything should flow through correctly (I think, without trying it). As most times, the best solution is to train the users to re-enter a new purchase order if they want to order more. If you leave all the “closed” PO’s there, it will be more concusing.

Thanks. That does sound like the best way. I tried to convince them not to use this method but that is the way they work. They have a “over receive variance” so lets say they can over receive 5% of the original ordered quantity. This allows them to receive another 20 units if the orriginal order was for 100 units. That is why the order must not be deleted. Not a good idea from my point of view but if your client does not want anything else but his way (and he pays the bills) just let him have his way. I am just trying not to totally stuff Navision in the process. Thanks again for the advice.

quote:


Originally posted by chrisk
There is a Flag that gets set when the Purchase Order is complete (EverythingInvoiced). If you use this, you will need to change less code and everything should flow through correctly (I think, without trying it). As most times, the best solution is to train the users to re-enter a new purchase order if they want to order more. If you leave all the “closed” PO’s there, it will be more concusing.


An other simple way that does no harm is to change the following lines -------------- IF (“Document Type” IN [“Document Type”::Order,“Document Type”::“Return Order”]) AND (NOT EverythingInvoiced) -------------- in: -------------- IF (“Document Type” IN [“Document Type”::Order,“Document Type”::“Return Order”]) -------------- Anna