I'm getting a event:OnSave error with the following snippet
function Form_onsave()
{
var GP = Xrm.Page.getAttribute("new_gp")
var QTY = Xrm.Page.getAttribute("quantity")
var PricePerUnit = Xrm.Page.getAttribute("priceperunit")
var CostPerUnit = Xrm.Page.getAttribute("new_costperunit")
GP.setValue
(
(
(parseFloat(PricePerUnit.getValue() != null ? PricePerUnit.getValue() : 0))-(CostPerUnit.getValue() != null ? CostPerUnit.getValue() : 0))
)*(QTY.getValue() != null ? QTY.getValue() : 0))
)
}
Its telling me
Error:unable to get property 'getValue' of undefined or null reference.
anybody spot what my eyes are blind to?
*This post is locked for comments