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
Vijayakumar KenchugunduVijayakumar Kenchugundu 

Expecting ')' but was: ','

Hi Friends,
I am getting this error (in the subject) in an Apex class which is called by an Apex Trigger. Not sure whether this SOQL in Apex Class is correct or not. Please help me to fix this:

public static Id AGENCY_RT_ID = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
List<Account> onlyTradBranches = new List<Account>();
List<Id> accountIds = new List<Id>();
onlyTradBranches = [SELECT Id,Office_Type__c,Status__c,RecordTypeId FROM Account WHERE RecordTypeId =: AGENCY_RT_ID AND ParentId IN : accountIds AND  Office_Type__c =: 'Traditional Branch' AND Status__c IN : ('Active', 'Pending')];

Many thanks in advance.
Best Answer chosen by Vijayakumar Kenchugundu
Dino KozićDino Kozić
Hello Vijayakumar,
the part of the query is problematic (you do not need the colon symbol). Please look at the correct way to write it:
... AND Status__c IN ('Active', 'Pending')