You need to sign in to do that
Don't have an account?
Nakata
How to retrieve subquery result from SOQL ?
Good day,
If i have following query :
Select a.Name , (Select userId From AccountTeamMembers WHERE TeamMemberRole='Sales') From Account a where id='0013000000H0EMSS'
How can i get the userId ?
Thanks in advance !
the outer account records will have a AccountTeamMembers property that's an array of the inner rows for that outer row, so you'd do something like
for (Account a: [select ....]) {
for (AccountTeamMember at : a.AcountTeamMembers) {
System.debug (at.userId);
}
}
All Answers
the outer account records will have a AccountTeamMembers property that's an array of the inner rows for that outer row, so you'd do something like
for (Account a: [select ....]) {
for (AccountTeamMember at : a.AcountTeamMembers) {
System.debug (at.userId);
}
}
Thanks Shailesh !
for ( AcountTeamMember at: acc.AcountTeamMembers) {
}