You need to sign in to do that
Don't have an account?
sadik Shaik
This code gives me (AccountTeamMember:{Id=01M0Q000000BOpJUAW, UserId=0051r000008izgPAAQ, TeamMemberRole=Deal Support - Product Management, AccountId=0010Q000003EwAaQAK}, AccountTeamMember:{Id=01M0Q000000A50ZUAS, UserId=0051r000008kFJRAA2, TeamMemberRole=Account Owner, AccountId=0010Q000003EwAaQAK})
And then i would like to get user details from the above user.id from User object and then Return a list of maps, for each map kay(Account team memberID: i want a list of user details and team member role. How can ia cheive this. Below is my code
How to make a list of maps, for each map key has list of values
[Select Id,User.id,TeamMemberRole from AccountTeamMember where Account.Id =: currentacc ];
This code gives me (AccountTeamMember:{Id=01M0Q000000BOpJUAW, UserId=0051r000008izgPAAQ, TeamMemberRole=Deal Support - Product Management, AccountId=0010Q000003EwAaQAK}, AccountTeamMember:{Id=01M0Q000000A50ZUAS, UserId=0051r000008kFJRAA2, TeamMemberRole=Account Owner, AccountId=0010Q000003EwAaQAK})
And then i would like to get user details from the above user.id from User object and then Return a list of maps, for each map kay(Account team memberID: i want a list of user details and team member role. How can ia cheive this. Below is my code
List<AccountTeamMember> AccountTeamMemberList = [Select Id,User.id,TeamMemberRole from AccountTeamMember where Account.Id =: currentacc ];
Just a clarification ----- do you need a map with AccountTeamMemberId as key and the value is the related user details?
then it must be : Map<Id,user> ---- Id is AccountTeamMemberId and user -- related record of AccountTeamMemberId
Thanks
Its not possible to have user object record and other details in one value .So The above solution might be helpful to you.
Let me know for any queries.Hope this will be helpful.
Thanks
Hope this works.
Here you have to query the user details using user.id and store in user record of map.
Or you may use two maps:
map<id,userdetails>
map<id,accountTeamMemberdetails>
Please let us know if this helps.
Happy to help further.
Kindly mark this as solved if the reply was helpful.
Thanks,
Gulafsha