Item Maintenance Post read on the ItemCode Script: retVal = oScript.DeactivateProcedure("*") sItemCode = "" oItem = oSession.GetObject("CI_ItemCode_bus") if oItem 0 then Set oItem = oScript.AsObject(oItem) end if retVal = oBusObj.GetValue("ItemCode", sItemCode) retVal = oItem.SetKey(sItemCode) retVal = oItem.GetValue("StandardUnitCost", nStdCst) retVal = oItem.GetValue("LastAllocatedUnitCost", nLastAlloc) retVal = oItem.GetValue("UDF_Current_Warranty_Cost", nWarranty) retVal = oItem.SetValue("UDF_COST_TOTAL", nStdCst + nLastAlloc + nWarranty) retVal = oItem.Write() end if retVal = oScript.ActivateProcedure("*") It runs recursively and errors after 64 loops.
↧