function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JoshTonksJoshTonks 

Variable does not exist: Integer

Im trying to create some simple counters. It is going to be more filtered down then this but im getting an error on the 3 and 9 line Variable does not exist: Integer. I think im missing something out because im sure that ive written something similar many moons ago.
public class StatusCheck {
    public Integer getCaseCounter(){
    	return (Integer) = [SELECT count()
                          	FROM Case
                          	WHERE Type =: 'Install'
                          	];
	}
    public Integer getOppCounter(){				
    	return (Integer) = [SELECT count()
                          	FROM Opportunity
                          	WHERE Type =: 'New Business'
                         	];
    						

	}
}

 
Best Answer chosen by JoshTonks
Alain CabonAlain Cabon
 
public class StatusCheck {
    public Integer getCaseCounter(){
    	return  [SELECT count()
                          	FROM Case
                          	WHERE Type = 'Install'
                          	];
	}
    public Integer getOppCounter(){				
    	return  [SELECT count()
                          	FROM Opportunity
                          	WHERE Type = 'New Business'
                         	];
    						

	}
}


https://developer.salesforce.com/forums/?id=906F0000000DBEnIAO
 

All Answers

Alain CabonAlain Cabon
 
public class StatusCheck {
    public Integer getCaseCounter(){
    	return  [SELECT count()
                          	FROM Case
                          	WHERE Type = 'Install'
                          	];
	}
    public Integer getOppCounter(){				
    	return  [SELECT count()
                          	FROM Opportunity
                          	WHERE Type = 'New Business'
                         	];
    						

	}
}


https://developer.salesforce.com/forums/?id=906F0000000DBEnIAO
 
This was selected as the best answer
JoshTonksJoshTonks
Thanks Alain thats fixed it.