Notify manager when SO unit price is changed

10.2.700.6

We would like to send a notice to a manager if someone changes the unit price on an order. We have some parts that have a list price of 0 because we have to price them each time, so our customer service folks do have to be able to change the price on those.

I have a BPM that runs for saved records and sends the before and after values.

My problem is this: if a user changes the price before the record is saved, the BPM does not catch it. I have gone through various trace logs trying to see if there is a method invoked anywhere, but there does not seem to be. There are several iterations of the dataset, based on the changed prices.

So, I am now thinking that this particular piece must be handled with a UI customization.

Thus far, my customization experience has been limited to little things, like adding UD fields to a page.

In my ideal world, the user would be forced to save the record before changing the price. That way the BPM could pick up any of the changes. So is there a way for logic attached to the UnitPrice field to know that the record is not yet saved (line number = 0 or something)?

Does this approach make sense? Is there a better way?

Thanks

1 Like

On your BPM for RowMod=“A” (new rows) just look at the Price on the Part and Compare it to the Price on the order, if they aren’t the same it has changed , then send the email :wink:

If it uses a price list same principle applies, look at the related pricelist on the order line and if the price on the pricelist doens’t match the price on the line and the rowmod is A (add) then send the email.

Would I need a variable to hold the UnitPrice from the part table while the BPM does the comparison? Sorry if this is a dumb question; still new to this part of Epicor.

And… yes, almost everything is on a customer group / product group price list. So I will have to re-create the price list logic to get a good comparison. Was trying to avoid that, but it may not be possible.

@skhayatt This routine I use on a standard data directive for customer changes. You should be able to move it to OrderDtl and do the same checks. The OldOrderDtl should have the previous price.

Email Customer Change Sample.cs (3.6 KB)

1 Like

You don’t have to recreate the price list logic you already have the price list on the order line you just need to do a lookup

1 Like

Thanks. This is a wonderful example.

Still have not figured out how to capture old value for comparison purposes.

And… I should point out that I live in a widget world - no straight up coding. I have no coding background. That may make a difference.

Use case
User creates order line
User enters part number (unit price = 100)
User enters quantity of 1 (unit price = 50, based on price list)
User changes price to 25 (this is what we want to capture)

Methods and UnitPrice parameter for each step

User creates new line
  <methodName>GetNewOrderDtl</methodName>
    <parameter name="ds" type="Erp.BO.SalesOrderDataSet">

User enters part number
  <methodName>ChangePartNumMaster</methodName>
  <parameters>
colName="UnitPrice"><![CDATA[0]]></changedValue>
      <changedValue tableName="OrderDtl" rowState="Added" rowNum="1"

User changes quantity
  <methodName>ChangeSellingQtyMaster</methodName>
    <parameter name="ds" type="Erp.BO.SalesOrderDataSet">
colName="UnitPrice"><![CDATA[100.00]]></changedValue>
      <changedValue tableName="OrderDtl" rowState="Added" rowNum="1"

  <methodName>ChangeUnitPrice</methodName>
    <parameter name="ds" type="Erp.BO.SalesOrderDataSet">
colName="UnitPrice"><![CDATA[50.00]]></changedValue>
      <changedValue tableName="OrderDtl" rowState="Added" rowNum="1"

User saves record
  <methodName>MasterUpdate</methodName>
    <parameter name="lCheckForOrderChangedMsg"
colName="UnitPrice"><![CDATA[25.00]]></changedValue>
      <changedValue tableName="OrderDtl" rowState="Added" rowNum="1"


Approach
I created a variable, OldUnitPrice, to hold the “before” value and then tried to compare it to the “after” value. The displays a message based on the comparison and the message contains both the variable value and the ttUnitPrice value

Create variable and set equal to parameter.

image

Evaluate this condition

Results
The variable does not appear to capture the “before” value. None of the tests resulted in the “value has changed.”

  • Pre-processing method directive on ChangeUnitPrice:

    • Variable value = 50
    • Temp table value = 50
  • Post-processing method directive on ChangeUnitPrice:

    • Variable value = 25
    • Temp table value = 25
  • Pre-processing method directive on MasterUpdate:

    • Variable value = 25
    • Temp table value = 25
  • Standard data directive on OrderDtl:

    • Variable value = 25
    • Temp table value = 25
  • In-transaction data directive on OrderDtl:

    • Variable value = 25
    • Temp table value = 25

It seems like this should be possible; I hope I am missing something basic.

Thanks.