I'm running v4.50. On Item Maintenance, I want to display a calculated field ("DealerPrice") that is 10% off of the Standard Unit Price. I have been able to accomplish this by adding a UDF to the CI Item Master table to store the DealerPrice, and then having a user defined script set the UDF_DealerPrice any time the StandardUnitPrice changes. Here are the details of the script: Table: CI Item Master Event: Column - Post Validate Field: Standard Unit Price Script: Set_DealerPrice This script is as follows: retVal = 0 tmpVal = 0 retVal = oBusObj.GetValue("StandardUnitPrice", tmpVal) retVal = oBusObj.SetValue("UDF_DEALERPRICE", tmpVal*.9) if retVal 1 Then MsgBox "Setting Dealer Price field failed: " & oBusObj.LastErrorMsg End if I have two questions: 1. Is there a better way to do this? All I want is to have a read-only textbox on the Item Maintenance form that displays 90% of the StandardUnitPrice. 2. If my current approach is the best one, the problem I am having is that when I use the "Automatic Cost and Price Change" utility to increase all prices by a few percent, the UDF_DealerPrice field is not updated to be 90% of the new StandardUnitPrice. It seems the Column - Post Validate script is not run when the "Automatic Cost and Price Change" utility updates the StandardUnitPrice. How can I get the UDF_DealerPrice to always stay accurate, even when the price changes by the user or by the Price Change utility. Thank you for your help! -blazeboy
↧