Any gueses why I am getting error?

for(Case cs : cases){
                Integer limit = Integer.valueOf(Label.Old_Request_Limit); // line-28

                if(cs.OldRequest__c == 'Yes' && caseList.size() > limit){

The error coming:

expecting a semi-colon, found 'limit'

  • 1
    I can't find any error. Maybe limit is a reserved keyword in Apex. Did you try to change the limit variable name? Commented Aug 10, 2017 at 13:01
  • Right. When I change variable name limit to value. Its work. Commented Aug 10, 2017 at 13:08

1 Answer 1


Limit is an reserved word in salesforce , You can't used as variable name.

Find All reserved Word Reserved Keywords

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .