Scripting

  • 1.  Question: how to do a calculation in a UDF?In CI_

    Posted 04-04-2013 09:29
    Question: how to do a calculation in a UDF? In CI_Item there is a UDF called ""Burden Amount"", which is the part of the standard unit cost they consider burden. In PO entry I can pull that in with a linked UDF I created called ""Burden Unit Cost"". I want to show the extended burden cost, which would be a calculation [qty ordered * BurdenUnitCost] Do I have to do that with an event script? Or is there some advance field setting I don't know about yet?. Anyone have examples of a script like this? I ""assume"" it is relatively simple.


  • 2.  RE: Question: how to do a calculation in a UDF?In CI_

    Posted 04-04-2013 09:58
    Here is a script I used to calculate based on an SO lines UDF, on the Column post validate event for the UDF_CWT_PRICE column, which sets the UnitPrice field: retVal = 0 'retVal = oSession.AsObject(oSession.UI).MessageBox(""got here"") retVal = oBusObj.GetValue(""UDF_ITEM_WEIGHT$"",strWeight) dblWeight = 0 CWT_Price = 0 dblPrice = 0 retVal = oBusObj.GetValue(""UDF_CWT_PRICE"", CWT_Price) If IsNumeric(strWeight) then dblWeight = Cdbl(strWeight) If dblWeight <> 0 then dblPrice = (CWT_Price * dblWeight)/100 End if End if retVal = oBusObj.SetValue(""UnitPrice"",dblPrice)