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?
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
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.
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