Good day,
I've been stuck on this for days now and I can't make any progress.
I'm trying to create a OnChange event to trigger when the OptionSet is changed to calculate a new weighted value i.e.-
value * probability /100 = new read only field
value = Currency "estimatedamount"
probability= OptionSet(25/50/75) "leadqualitycode"
new read only field= Currency "pi_weightedestvalue"
I've created a Web Resource with the following Java...however I'm further away now than I was three days ago.
---------------------------------------------------------------
function UpdateField() {
est = Xrm.Page.GetAttribute("estimatedamount").getValue();
prob = Xrm.Page.GetAttribute("leadqualitycode").getValue();
if(est.getValue() != null)
{
Xrm.Page.GetAttribute(pi_weightedestvalue).setValue( est * prob * 0.01)
Xrm.Page.getAttribute("pi_weightedestvalue").setSubmitMode("always");
}
---------------------------------------------------------------
Any help is hugely appreciated.
Regards,
Craig.