troubleshooting Question

CRM 2011 JavaScript "Weighted Value" Any help is really appreciated.

Avatar of Performance_Improvements
Performance_Improvements asked on
JavaScriptMicrosoft Dynamics
3 Comments1 Solution970 ViewsLast Modified:
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.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros