When we adjust a PO (i.e. change a release due date or a line quantity), the UnitPrice automatically recalculates based on the price list. Many times, however, we use a custom UnitPrice on a PO and DO NOT want the price list to overwrite UnitPrice. Is there a way to prevent the PO from recalculating the UnitPrice on update?
Epicor will re-read the price list in case the date or quantity would change the price. I added a checkbox labeled lock price and stash the price on PO update pre-processing and then reset on post processing.
/* Save PO Price if Hold is checked */
For each ttPODetail.
If ttPODetail.CheckBox02 = false or ttPODetail.Number01 = ttPODetail.UnitCost then next.
ttPODetail.Number01 = ttPODetail.UnitCost.
/* Reset Locked Price */
For each ttPODetail.
If ttPODetail.CheckBox02 = false or ttPODetail.Number01 = 0.00 or ttPODetail.UnitCost = ttPODetail.Number01 then next.
Message " DEBUG Update Post " + string(ttPODetail.PartNum) + string(ttPODetail.Number01). ttPODetail.UnitCost = ttPODetail.Number01. ttPODetail.DocUnitCost = ttPODetail.Number01.
I just had a buyer tell me this happened to their PO and I thought they were nuts.
Why would a system do this?
Thanks for the logic to correct this problem.
Wouldn’t enabling the ‘Override Price List’ checkbox accomplish the same thing? Or would it just go to zero?
I’m not aware of an override price list on the PO side, just on the Sales order.
It looks like one needs to also apply this to the PO.ChangeDetailCalcOurQty method because when changing quantity on the line tab the PO.Update method doesn’t fire, thus causing the pricing to still change.
Is this what you did?
Good Catch. I just looked at my method directives and I have the reset price post processing on ChangeApproveSwitch, ChangeDetailCalcOurQty, ChangeRelOurQty and CheckComplianceFail
Still having some issues. I do the following: change a line price, hit save (PO.Update runs), then go to releases and change the qty (PO.ChangeRelOurQty runs and so does PO.Update).
After the first PO.Update, the numbers are stored properly. After the second PO.Update, the numbers revert back to the price list.
I think I have your code exactly implemented. Are there any other directives running tied to this?
It looks like I must have thrown everything at it and never took any of them back off. I have 2 data directives also saving and retrieving the price. All of them are attached. Now I am curious if I need any of the method directives.
Good to know. One less thing to deal with when I get to 10.
No need to be curious… I disabled multiple methods, tested, but they are still needed. Thank you!!
Thanks for checking. I hate bogging down the system with extra bpm coding.
I had to re-open this issue because we found a problem. When creating a PO through New PO Suggestions, the “lock price” checkbox doesn’t get defaulted to checked.
The appropriate methods to use seem to be POSugg.Update or POSugg.Generate, but so far I can’t figure out how to get my checkbox02 to be set to true.
Did you figure out this piece of the puzzle?
I have this DD on PODetail. Was it in what I sent to you? one of the issues that comes up with post processing on generate is the PO is not fully formed yet when your code fires. I have a routine that moves information from the buyers wb to the PO after it is created and it has to be done it 4 separate directives to avoid the record changed while you were holding it messages.
Are you looking in the appserver logs for any messages like that?
/* Save PO Price and check Hold when created */
For each ttPODetail where (ttPODetail.RowMod = ‘A’ or ttPODetail.RowMod = ‘U’) and ttPODetail.Company = cur-comp and ttPODetail.UnitCost <> 0 and ttPODetail.Checkbox02 = false.
ttPODetail.CheckBox02 = true. ttPODetail.Number01 = ttPODetail.UnitCost.
Thanks. I think I removed the ttPODetail.CheckBox02 = true from your original example because it was always setting it to true (on add and update).
I just modified that portion to only set to true on add, ignoring the updates.