You need to sign in to do that
Don't have an account?
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>();
accountIds.add(account.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.
Vijay
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>();
accountIds.add(account.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.
Vijay
the part of the query is problematic (you do not need the colon symbol). Please look at the correct way to write it: