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)

OData query

(0) ShareShare
ReportReport
Posted on by 2,510

Hi, I am trying to convert fetchxml query to OData, how can I filter out related entity through OData query

<fetch>
    <entity name="invoice" >
        <attribute name="name" />
        <attribute name="totalamount" />
        <attribute name="invoicenumber" />
        <link-entity name="account" from="accountid" to="customerid" >
            <filter>
                <condition attribute="customerid" operator="eq" value="4794394" />
            </filter>
        </link-entity>
    </entity>
</fetch>


*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi

    You can  use rest builder tool to generate odata query

    https://github.com/rappen/FetchXMLBuilder/issues/4

    Thanks,

    Ridhima

  • Verified answer
    Community Member Profile Picture
    on at

    Hi sdnd2000 ,

    To add a filter to an OData URI, add $filter= to the end of the name of the published web service. And use $expand to join entities, the example is like this:

    https://[BaseURL]/Data/$metadata /Invoice?$select=Name,Totalamount,InvoiceNumber&$expand=Account&$Select=AccountId,CustomerId&$Filter=CustomerId eq ‘4794394’

    ODATA filter official docs:

    https://docs.microsoft.com/en-us/dynamics-nav/using-filter-expressions-in-odata-uris

    You could refer to this article with topic ‘4.6. Expand System Query Option ($expand)’ which is a 3rd party blog for your reference.: https://www.odata.org/documentation/odata-version-2-0/uri-conventions/

    Best regards

    Tom Cai

  • Community Member Profile Picture
    on at

    The OData query language is based on the Open Data Protocol (OData) standard. It allows developers to retrieve, update, and delete data from a server using a RESTful API. Reading rush essay review is the best habit so as to get a writer. The language supports different types of queries and parameters, including filtering and sorting.

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