Hi... I have written a small script to automatically populate a udf on the price code screen. The field will do a small calculation, and upon the entry of the new cost, will quickly calculate the new cost markup percentage. Here is the script: I don't get any errors now, but nothing seems to happen when the entry of the new cost gets made. It is supposed to fire on the post validate of the new cost field. percent = 0 std = 0 price = 0 pctnew = 0 item = "" cust = "" retVal= oBusObj.GetValue("CustomerNo$", cust) retVal= oBusObj.GetValue("ItemCode$", item) retVal= oBusObj.GetValue("DiscountMarkup1", percent) retVal= oBusObj.GetValue("StandardUnitCost", std) retVal= oBusObj.GetValue("UDF_UNIT_COST", price) retVal= oBusObj.GetValue("UDF_COSTPCT", pctnew) if std 0 then retVal = oBusObj.SetValue = pctnew = ((std - price) / std) * -100 end if Any ideas? This would be great if we can make it work. B
↧