When a line on a sales order is marked buy to order and is linked to a PO, you cannot change the part number. You cannot reduce the SO line quantity to less than the Linked PO Release Quantity:
If you want to increase the SO line quantity you get a message to notify Purchasing.
If the user fails to notify purchasing, a new PO suggestion will be created anyway for the additional quantity needed.
This all works as I think it should.
Here is the problem. A sales order release (that is marked BTO) can be manually closed by the sales team, even if it is already linked to a PO (without a message or anything).
If EPICOR will not let you reduce the SO quantity on a BTO line linked to a PO, why does Epicor let a salesperson CLOSE a SO release (essentially reducing the quantity to 0) that is marked BTO and linked to a PO? Epicor says this is the way it has worked for a long time, so they claim it is working as intended.
I would like to prevent a user from closing an Order, Line, or Release that has at least 1 open release that is linked to a PO.
I have run a trace and have seen the Methods as CloseOrder, CloseOrderLine, or CloseRelease.
What is the best way to prevent a user from closing an Order, Line, or Release that has at least 1 open release that is linked to a PO? I have tried a pre-processing MethodDirective (starting with CloseOrder) and I was still able to close the order.
On my Erp.BO.SalesOrder.CloseOrder - preprocessing method directive, I put in the condition: “Number of rows in the Query is more or equal to 1”.
The query links the result.OrderHed table to the ERP.OrderRel with the criteria on the OrderRel as OpenRelease = true and PONum > 0.
I have a BAQ with the Erp.OrderHed table linked to the Erp.OrderRel, using the same criteria on the Release (the criteria on the OrderHed is = to the order number I am testing.
A strange thing is occuring. I have a leftover informational message, but for some reason, Epicor seems to skip this message and jump right to my Exception message:
Kevin,
In an effort for me to learn, what makes the message box + Complete Method Call better than the raise exception that “Terminates on Error”?
Brian
Here is a new wrinkle. I wanted to allow users to void a line even if a PO is suggested, but not yet created. A user can delete a line after a PO is suggested but not yet linked and then if the buyer tries to generate a PO for that deleted line, they get an error that the suggestion is no longer valid. For pending suggestions, it seems like Epicor only evaluates if the “line/release to be ordered” has been deleted but does not care if it has been voided.
I guess I will need to change my queries, but not sure what the flag is called for PO Suggested?