Link to home
Start Free TrialLog in
Avatar of twardnw
twardnwFlag for United States of America

asked on

Use a percentage on a form

Scenario: Our sales staff puts in an estimated value, and probability, which generates a weghted value, when an opportunity is created. They would much prefer entering an actual percentage for the probability, rather than a decimal. How can I set this up and still have CRM calculate the weighted value.

One way which just sprung to mind would be to divide value of the probability by 100, then perform the calculation. I'll test that now, but am still open to suggestions.
SOLUTION
Avatar of WilyGuy
WilyGuy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of twardnw

ASKER

Hmm, hadn't thought of a picklist, that might work. What should the syntax be? Right now I have in the onChange event for the estimated value and probability:

crmForm.all.new_weight.value = crmForm.all.estimatedvalue.value*crmForm.all.new_probability.value;

and that generates a NaN value in the weighted value on the form.

Just talked it over with our sales guy, he is in favor of doing it as a picklist, so I'll start on that, any hints on the syntax for that?
Basically you're looking for an OnChange or OnSave on the picklist that updates a another value that is either not on the form or hidden on the form.

So if you pick 10%, it will update the other field.
Avatar of twardnw

ASKER

Would I just be referencing it as new_picklist.value ?

Where value 1 = 0%, value 2 = 5%, value 3 = 10%, etc.

How would to code for that work? The attributes I am work with are:

new_weight - this is the calculated value, money type attribute
estimatedvalue - 'money' type attribute
new_opp_probabilitypick - picklist of %'s in 5% increments
new_probability - old probability attribute, I could use this to store the decimal value of each percent.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of twardnw

ASKER

Thanks guys, exactly what I was needing, got it working perfectly now!