Error in saving unable to apply filter on opportunity
global class batchClassOppUpdate implements Database.Batchable<sObject> {
global Database.QueryLocator start(Database.BatchableContext BC){
String query='Select id from OpportunityContactRole Where IsPrimary=true AND OpportunityId IN (SELECT Id from Opportunity where recordtype.name = 'XYZ Solutions')';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<OpportunityContactRole> Scope){
for(OpportunityContactRole a:scope){
a.isPrimary= true;
}
update scope;
}
global void finish(Database.BatchableContext BC){
}
}