Sales Order BPM

Hello forum!

My colleague and I are trying to create a BPM for the Unit Price of a Line item in the Sales Order Entry. The BPM is supposed to keep the Extended Price the same no matter what the Order Quantity of that Line Item is changed to. This would work by changing the Unit Price. So if the Unit Price was 10 and Order Quantity was 4, that would make the Ext. Price 40. We want it so if you change the Order Quantity to 2, the Unit Price would change to 20 so the Ext. Price would still be 40.

We are working on a Pre-Processing Method Directive on Erp.SalesOrder.ChangeSellingQtyMaster.
Our Design:

Our expression:
image

When we test it, we just end up getting this strange message that asks if we want to retain the current unit price. We click no, but the unit price just seems to change to zero when it should change to 20.

Is there something within the business logic of the system that is throwing this message? It seems kind of strange that this wont work. I even tried a simple expression of adding 2 to the Unit Price whenever the Order Qty changes. I tested this by changing the Order Qty of a Line Item with a unit price of 10. The new Unit Price of 12 actually shows up on that strange message that pops up but when you click yes, the unit price doesn’t change and stays 10. When you press no, the unit price changes to 0. So it seems like this weird message is preventing even that simple expression from working?

We did a trace of the process to see what this message was. It is the highlighted parameter at the bottom of the picture.

It has a “c” at the beginning of the name which is leading me to believe that it is custom, so created by somebody at the company before us? The thing is, we cannot find this custom message anywhere. So we are wondering if this is a message from the system because we are breaking some sort of Business Logic?

We have been stuck on this for quite some time now and figured we should try our luck with the people on the forums! Anything at this point would be helpful.

Thanks in advance!

In my experience, Data Directives are more predictable/easier to use than Method Directives. I would just try doing all this in a data directive on the OrderDtl table (In-Transaction). You’ll just have to add a little condition before your Set Field block.

That line:
<parameter name="cSellingQuantityChangedMsgText" type="System.String"><![CDATA[]]></parameter>
is in my trace too. So not custom.

Thanks!

Thanks, Ill give that a try and reply with the results

Trust me, what you are attempting is not “simple”. I would make use of a UD field to store the extended price. Then you can use code to calculate your “unit price” when the Qty changes.

3 Likes