You need to sign in to do that
Don't have an account?
Anu Yadav
soql query on opportunity
Hi,
I m using following query in my batch class where i m retrieving opportunity records whose account owner is not same as its owner.
Id EBPRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Partner Opportunities').getRecordTypeId();
return Database.getQueryLocator([Select Id,name,AccountId,StageName,OwnerId,Account.OwnerId From Opportunity WHERE OwnerId!=:Account.OwnerId and StageName IN ('Chance identified','Chance qualified','First offer','Finale offer') and RecordTypeid =: EBPRecordTypeId]);
getting error : Invalid bind expression type of Schema.SObjectField for column of type Id
Thanks,
Anu
I m using following query in my batch class where i m retrieving opportunity records whose account owner is not same as its owner.
Id EBPRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Partner Opportunities').getRecordTypeId();
return Database.getQueryLocator([Select Id,name,AccountId,StageName,OwnerId,Account.OwnerId From Opportunity WHERE OwnerId!=:Account.OwnerId and StageName IN ('Chance identified','Chance qualified','First offer','Finale offer') and RecordTypeid =: EBPRecordTypeId]);
getting error : Invalid bind expression type of Schema.SObjectField for column of type Id
Thanks,
Anu
All Answers