I have been fighting with this for a few days and cannot seem to figure out the appropriate concept/events to use for what I am trying to achieve. I created an initial script for the client that calculates a SO Line Gross Profit % UDF based on custom price and cost fields, and that works fine as PostValidate on Qty Ordered/Unit Price. Then they came back and asked that if there are changes made to the GPM% field that the Unit Price field should be recalculated. My draft appears to work fine for many items, but for some items, the recalc will change the Unit Price by a cent or so based on rounding (i.e. no changes are manually made to either the Unit Price or GPM, but I have no conditional clauses in yet so both scripts run and can cause the Unit Price to change slightly depending on the GPM%). I would like to try to figure out how to trigger the reverse recalc script
only on change to the GPM% UDF. I've been testing stored variables and pre-validate/prewrite events to see if I can capture the "original" GPM for comparison but all that happens is that I get thrown into a small loop of the two scripts wanting to keep recalculating each other. Hopefully this question is easy enough to visualize. Any suggestions would be welcome. Thanks in advance!
#scripting
------------------------------
Amber Prayfrock, Blytheco
------------------------------