You need to sign in to do that
Don't have an account?

Unexpected "unexpected token" error
Hi all,
I'm writing a class that performs some simple arithmetic based on opportunity probabilities to get the average probability of all that owner/account/product's opportunities. My class takes some IDs and strings, and I want it to create lists based on these input arguments, but keep getting the "unexpected token" error. Here's a snippet of the code:
public class ForecastFunction { public static double getProbability(ID own, ID acc, String product, String division){ double estimate = 0; List<Opportunity> a = [select Probability from Opportunity where OwnerID := own]; for(integer i = 0;i<a.size();i++){ estimate+=a[i].Probability/a.size(); } return estimate; } }
Where "own" is my unexpected token (both with and without the colon). What am I doing wrong? This should be bread and butter, but that error is crippling, and, to me, unobvious.
Any help you can offer would be great.
Thanks,
Lee
Oh my word... colon wrong side of equals sign.
Moron.
All Answers
Oh my word... colon wrong side of equals sign.
Moron.
Swith the equal sign and colon so it's =: