web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to find all Competitors associated with an Opportunity using the Web API

(0) ShareShare
ReportReport
Posted on by

I took a couple of my opportunities and assigned competitors to them.

Then I issued this request:

myorg.crm.dynamics.com/.../connections$filter=record1objecttypecode eq 3 and record2objecttypecode eq 123

and got back an empty result set.  According to the docs for connection entitytype: https://msdn.microsoft.com/en-us/library/mt607963.aspx

123 : Competitor  and   3 : Opportunity

I also tried:

dealcoachpro.crm.dynamics.com/.../connections$filter=record1objecttypecode eq 123

and

dealcoachpro.crm.dynamics.com/.../connections$filter=record2objecttypecode eq 123

both with empty results.

In fact, in my trial account the only other object record types (beside opportunity=3 and contact=2) are lead=4 and user=8.

If the competitors can't be retrieved by connection, how does one get at them?

THANKS IN ADVANCE.

*This post is locked for comments

I have the same question (0)
  • Brian Poff Profile Picture
    on at

    Competitors are linked to Opportunities via a many-to-many relationship rather than using connections. The bridge entity is OpportunityCompetitor so you may want to retrieve all competitor IDs from there and then fetch the competitors one by one.

  • Verified answer
    Community Member Profile Picture
    on at

    Use this:

    /api/data/v8.2/opportunities(BE0D0283-5BF2-E311-945F-6C3BE5A8DD64)?$select=name&$expand=opportunitycompetitors_association($select=name,websiteurl)

  • Community Member Profile Picture
    on at

    Awesome.  That was what I was looking for.  Thanks again!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans