Tuesday, September 11, 2012

CRM 2011-Javascript to multiple two fields

function CalculateLineCost()
{
var quantity=Xrm.Page.getAttribute("jmh_quantity").getValue();
var unitcost=Xrm.Page.getAttribute("jmh_unitcost").getValue();
if(quantity != null && unitcost)
{
var linecost=quantity*unitcost;
Xrm.Page.getAttribute("jmh_linecost").setValue(linecost);
}
}

Note:call this javascript on both two fields on change event

No comments:

Post a Comment