Skip to main content
Dynamics 365 general forum
Answered

How to query activities by it's regarding object ODATA/Fetch?

editSubscribe (0) ShareShare
ReportReport
Posted on by 60

How could I make a query for activities but filtering by regarding object. I mean there are activities regarding to lead, opportunitites, with odata or fetchXml

if I'd like to filter those regarthing to leads.

I've tried something like activitypointers?$select=activityid&$filter=_regardingobjectid_value@Microsoft.Dynamics.CRM.lookuplogicalname eq 'lead' but no works.  Any help. thanks.

Attachments
  • Suggested answer
    Torrado Profile Picture
    Torrado 1,270 on at
    RE: How to query activities by it's regarding object ODATA/Fetch?

    Hello Terry,

    With one of the tools that I suggested above you can create / test your fetchxml queries.

    FetchXMLBuilder is a XRMToolbox plugin, you can easily connect to your environment and use it to check that kind of scenarios.

    Hope this helps you.

  • TerryShowman Profile Picture
    TerryShowman 60 on at
    RE: How to query activities by it's regarding object ODATA/Fetch?

    Hi ty,  if I'd like to hake two entities could i use this?

    for Opportunities and leads? or I must separate them?

     
       
       
       
     
    

    Thanks.

  • Suggested answer
    Torrado Profile Picture
    Torrado 1,270 on at
    RE: How to query activities by it's regarding object ODATA/Fetch?

    Hello,

    for that kind of requirement, where you need to build a fetchxml or odata query, you can make use of two useful tools:

    Hope this helps you.

    Please mark the answer as verified if helpful. That will help others in future.

  • Verified answer
    meelamri Profile Picture
    meelamri 13,188 UG Leader on at
    RE: How to query activities by it's regarding object ODATA/Fetch?

    Hi, 

    please refer to this example: 

      
        
        
      
    

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,126 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,646 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans