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
JaanuJaanu 

soql error. .. pls help

select statment is giving error ... pls help... AccountId, Status fields on case object. 
    public static Integer getCaseCount(String recId) {
        
        return [SELECT COUNT() FROM Case WHERE Status !='Closed' AND AccountId=recId];
        
    }
    
Best Answer chosen by Jaanu
Raj VakatiRaj Vakati
Use this code
 
public static Integer getCaseCount(String recId) {
        
        Ireturn  [SELECT COUNT() FROM Case WHERE Status !='Closed' AND AccountId=:recId];

        return arr ;
    }

 

All Answers

Raj VakatiRaj Vakati
Use this code
 
public static Integer getCaseCount(String recId) {
        
        Ireturn  [SELECT COUNT() FROM Case WHERE Status !='Closed' AND AccountId=:recId];

        return arr ;
    }

 
This was selected as the best answer
v varaprasadv varaprasad
Hi Jannu,

Add colon (:)in like below.

AccountId =::recId

Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Thanks
Varaprasad
@For  Support: varaprasad4sfdc@gmail.com
Blog : http://salesforceprasad.blogspot.com/

 
JaanuJaanu
Thanks a lot everyone for quick answer.