Performance_Improvements
asked on
CRM 2011 JavaScript "Weighted Value" Any help is really appreciated.
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("est imatedamou nt").getVa lue();
prob = Xrm.Page.GetAttribute("lea dqualityco de").getVa lue();
if(est.getValue() != null)
{
Xrm.Page.GetAttribute(pi_w eightedest value).set Value( est * prob * 0.01)
Xrm.Page.getAttribute("pi_ weightedes tvalue").s etSubmitMo de("always ");
}
-------------------------- ---------- ---------- ---------- -------
Any help is hugely appreciated.
Regards,
Craig.
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("est
prob = Xrm.Page.GetAttribute("lea
if(est.getValue() != null)
{
Xrm.Page.GetAttribute(pi_w
Xrm.Page.getAttribute("pi_
}
--------------------------
Any help is hugely appreciated.
Regards,
Craig.
What happens when you try to execute this? Also how familiar you are with JavaScript and XRM Page object model?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Feridun,
You are my hero, your solution worked perfectly first time. I now get a weighted value that saves correctly and without errors.
Kindest regards,
Craig.
You are my hero, your solution worked perfectly first time. I now get a weighted value that saves correctly and without errors.
Kindest regards,
Craig.