Hey all,
I'm new to using dynamics and need to query a specific opportunity entity by Id and get an array of all users included in its sales team. I'm trying to use the method of retrieving related entity records described in this documentation:
https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/retrieve-related-entities-query#retrieve-related-entities-by-expanding-both-single-valued-and-collection-valued-navigation-properties
The issue is that the link between an opportunity and a team member has to go through an intermediate team entity. I am trying to query opportunity entity => opportunity_Teams => teammembership_association => fullname (of team member). Am I going about this double expansion in an advisable way?
An attempted query:
opportunities?$select=opportunityid,name,_parentaccountid_value&$filter=opportunityid eq 'some-opp-id'&$top=10&$expand=opportunity_Teams($expand=teammembership_association($select=fullname))
This query isn't returning anything for the team members in teammembership_association array even though the opportunity I am requesting has a member in the UI. Is opportunity_teams the correct field to be looking for that team member link? Is there something else I'm doing wrong?
Greatly appreciate any advice.
Opportunity entity documentation I've been following:
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/opportunity?view=dynamics-ce-odata-9