How to get the team members details from a team ID in Dynamics CRM 2011/2013 Using OData Call

Recently I had the requirement to display the list of team member details like User Name, Full Name etc. in java script.
I was using the Odata designer tool found at http://crm2011odatatool.codeplex.com/
but since team members is a many to many relationship between User and Team I knew that I have to use the $expand tag in the Odata on the teammembership_association , which is the name of the many to many relationship here.

But my confusion started because I was trying to retrieve it using the entity name “TeamMembershipSet” which was causing the Odata query to fail when I try running it in the Browser.
But finally I found that I need to use TeamSet instead of TeamMembershipSet or SystemUserSet.
so the below query worked flawlessly for me.

https://servername/xrmservices/2011/OrganizationData.svc/TeamSet?$select=teammembership_association/DomainName,teammembership_association/FullName,teammembership_association/SystemUserId,teammembership_association/IsDisabled&$expand=teammembership_association&$filter=TeamId eq guid’8e033b49-6e7f-e311-9359-d89d6765b238′

though I struggled a bit due to the confusion with the presence of teammembership entity name in the list, I am glad I could finally figure it out. posting it for others who might have similar difficulty.

Advertisements
This entry was posted in CRM 2011, CRM 2011 Online, CRM 2011 SDK, CRM2013, java script, OData and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s