You need to sign in to do that
Don't have an account?
Sylvain@RibbonFish
AccountContactRole and Account Relationship
Hi everyone,
I got this code:
List<String> Name = new LisT<String>();
List<AccountContactRole> listTemp = [Select Id,AccountID,Account.Name From AccountContactRole];
for(AccountContactRole acr : listTemp)
{
Name.add(acr.get('Account.Name'));
}
I got this error:
Invalid field Account.Name for AccountContactRole
Or in a visualpage if I want to access to this field I do:
<apex:column value="{!myVar.Account.Name}"/>
And it's working.
So How I can access to Name via Apex without doing a query again?
Thanks
Name.add(acr.Account.Name);