You need to sign in to do that
Don't have an account?
Issue with APEX code
OK. I've been doing this for years and suddenly I'm getting an error("expecting right curly bracket, found 'For'"). Here's the class. Can anyone tell me why I'd be getting this error for my FOR statement?
publicwithsharingclass Monthly
{
public List<Id> lstBudId = new List<Id>();
publicSet<Id> setBudId = newSet<Id>();
//Get list of budget periods that are older than today
public List<Budget_Period__c> lstCBP = new List<Budget_Period__c>
([SELECT ID, BUDGET__C
FROMBudget_Period__c
WHERE PERIOD_END_DATE__C >= TODAY]);
For(Budget_Period__c cbp : lstCBP)
{
if(!setBudID.contains(cbp.Budget__c))
{
setBudId.add(cbp.Budget__c);
lstBudID.add(cbp.Budget__c);
}
}
}
You look to be missing a method here - you have declared your getter/setter and then it looks like you've jumped straight into code.
All Answers
You look to be missing a method here - you have declared your getter/setter and then it looks like you've jumped straight into code.
Yup. That was it. I'm guessing I need more sleep.
Thanks for your quick and accurate response.