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

i jus need help in for loop
List<Contact> accounts=[SELECT Email FROM Contact WHERE AccountId ='001i000000g7erl' ORDER BY Email ASC NULLS FIRST LIMIT 3];
list<Id> emailid=new list<id>();
for(id acc: Email)
{
acc.emailid[Email];
}
wat is worng in this can u explain me im new to apex code
list<Id> emailid=new list<id>();
for(id acc: Email)
{
acc.emailid[Email];
}
wat is worng in this can u explain me im new to apex code
Try to call query variable in for loop:
List<Contact> accounts=[SELECT Email FROM Contact WHERE AccountId ='001i000000g7erl' ORDER BY Email ASC NULLS FIRST LIMIT 3];
list<Id> emailid=new list<id>();
for(id acc: accounts)
{
acc.emailid[accounts];
}
If it resolves your problem, please hit kudos..