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

invalid relation ship please help
i am trying to execute the code in developer console, but i am getting this error. please some one help me.
Invalid foreign key relationship: Account.contact
Invalid foreign key relationship: Account.contact
map<string,list<string>> m2=new map<string,list<string>>(); for(account a1:[select id,name,(select id,lastname,phone from contacts cons) from account]) { m2.put(a1.name,a1.contact.phone); }
To iterate the accounts/contacts and generate a list of phone numbers against account name you'd need something like: