RE: Convert items in Option Set into Value (Currency)
My code is:
function calculateTotal()
{
var soft = Xrm.Page.getAttribute("new_softwarerevenue").getValue();
var serv = Xrm.Page.getAttribute("new_servicerevenue").getValue();
var dev = Xrm.Page.getAttribute("new_developerrevenue").getValue();
var oth = Xrm.Page.getAttribute("new_otherrevenue").getValue();
var tot = Xrm.Page.getAttribute("new_totalestimatedrevenue");
var add = soft+serv+oth+dev;
if(soft !=null || serv != null || dev != null || oth != null)
{
tot.setValue(add);
}
else {return;}
var probability = Xrm.Page.getAttribute("new_probability").getText();
if (probability != "")
{
var percent = parseFloat(probability);
var oppValue = tot * percent/100;
Xrm.Page.getAttribute("new_opportunityvalue").setValue(parseFloat(eval(oppValue)));
}
}