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

how to get opportunities that are not assigned any task
I want to get all opportunities that are not assigned any task from last week and i want to display those opportunity names with command link in visualforce page, when i click those opportunities, opportunity details will be displayed for this scenario i am writing some code. In this code i am fetching all the tasks whatids and store that ids into another list but it throws error like "Incompatible argument type List<Opportunity> for All method on List<Id>" can any one help me to resolve this error.
my class
public class getoppsoftask {
public date d=date.today();
List<Task> oppids=[SELECT Whatid FROM Task];
List<Opportunity> opplist=[SELECT ID, Name FROM Opportunity WHERE StageName!='Closed'];
List<id> opids=new List<id>();
opids.addAll(opplist);
}
my class
public class getoppsoftask {
public date d=date.today();
List<Task> oppids=[SELECT Whatid FROM Task];
List<Opportunity> opplist=[SELECT ID, Name FROM Opportunity WHERE StageName!='Closed'];
List<id> opids=new List<id>();
opids.addAll(opplist);
}
Both lists must be of the same type.
Try referring to the below :
LIST<Account> aList = new LIST<Account>{new Account(), new Account()};
LIST<sObject> sOjbList = new LIST<sObject>();
sOjbList.addAll((List<sobject>)aList);