You need to sign in to do that
Don't have an account?

Illegal assignment from LIST<Opportunity> to LIST<Opportunity>
Did anone face this issue in APEX Class?
I a
Code
List<Opportunity> oppoList = [SELECT Id, Broker_Agent__c, Seller__c, Primary_Contact__c FROM Opportunity WHERE Id = : opportunityRoles.keySet()];
I am not getting this error in Prod but when I copied the code from Prod to Full sandbox, its failing deployment with Illegal assignment from LIST<Opportunity> to LIST<Opportunity> error. Not sure whats wrong. Any suggestion/info is appreciated.
Thanks
I a
Code
List<Opportunity> oppoList = [SELECT Id, Broker_Agent__c, Seller__c, Primary_Contact__c FROM Opportunity WHERE Id = : opportunityRoles.keySet()];
I am not getting this error in Prod but when I copied the code from Prod to Full sandbox, its failing deployment with Illegal assignment from LIST<Opportunity> to LIST<Opportunity> error. Not sure whats wrong. Any suggestion/info is appreciated.
Thanks
All Answers
Error: Compile Error: Invalid initial value type LIST<Opportunity> for LIST<Opportunity> at line 502 column 38
You need to run below query in developer console. If it work in developer console than it mean error is not in query, you are looking error at wrong place.
Have you created any class with "Opportunity" Name, if yes, delete that class.
else use the below code.