You need to sign in to do that
Don't have an account?
Deepak agarwal 9
List error
public with sharing class lead_create {
public lead_create(){
set<id> lead_l=new set<id>();
lead_l=[select id from lead where rating like:'%hot%'];
task t=new task(subject='email',whoid=lead_l.id);
insert t;
}
}
Error: Illegal assignment from List<Lead> to Set<Id> at line 4 column 1
Please help!!
Thanks in advance
You are assining list values to set.
This query [select id from lead where rating like:'%hot%'] returns list.
Try below code.
Thanks,
Dilip.
I am getting these error on your code.
Error: Initial term of field expression must be a concrete SObject: Set<Id> at line 8 column 39
can u tell me what line 2 is doing exactly..
y cant we use just set y ua using maps again since it contains only ids we can hold them in set?
Can you please explain 'what exactly you are trying to do'?
Thanks.
It gets existing leads via SOQL request, creates map of Ids of this record to records itself and then takes keys (e.g. Ids).
In your code you create Tasks, not leads.
Please clarify your business logic.
Regards,
Ivan