twardnw
asked on
Calculated money values above 1000 generate 'NaN'
Overall goal : calculate a 'weighted revenue' for an opportunity based on the estimated revenue and a probability percent. Probability is a picklist of % values, with an onChange script to generate the weighted value.
With any estimated value over $1000 (which CRM reformats as 1,000.00), the weighted value changes to 'NaN'. Here is one line of my script to calculate this value:
crmForm.all.new_weight.val ue = 0.5 * crmForm.all.estimatedvalue .value;
if I change to using .DataValue, no amount is calculated for the weighted value.
With any estimated value over $1000 (which CRM reformats as 1,000.00), the weighted value changes to 'NaN'. Here is one line of my script to calculate this value:
crmForm.all.new_weight.val
if I change to using .DataValue, no amount is calculated for the weighted value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok, had another issue to take care of so I called our MS Partner, I was unaware that CRM was case sensitive. Changing .datavalue to .DataValue solved the issue. You had me in the right direction, just my noobness got in the way. Thanks for your help.
Ah - makes sense - I've spent more hours frustrated with case sensitivity of JavaScript than I'd like to admit. Glad it worked out for you.
ASKER
crmForm.all.new_weight.Dat
doesn't generate anything at all, the new_weight attribute does not change
2) we are using only user-entered info for estimated value
3) field is not r/o
4) That was asking how to have the percentage on the form to use for the calculation, this is asking the exact syntax on the calculation. I closed that one before I realized it wasn't working, I didn't include any values over 1000 when I tested, salesperson pointed it out to me later.