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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

FetchXML filter by EntityReference prop. Name

(0) ShareShare
ReportReport
Posted on by

Hi all.
I'm using fetchXML to fetch the data. I have EntityColection in result of _service.RetrieveMultiple(xml_query). Entity has attributes of type Microsoft.Xrm.Sdk.EntityReference. These attributes contain such properties "Id","Name","LogicalName".
Please, help me to build the correct query to set filters and orders by this fields.
For example, sql is like this:

SELECT Id, name, cur_price, manufacturerId_Name
FROM tb_goods WHERE cur_price > 10 AND manufacturerId_Name LIKE '%jumbo%'
ORDER BY manufacturerId_Name
LIMIT 10

I'm trying to make it on server (c#). Is it possible to use manufacturerId_Name in query directly ? Maybe it needs to use some chars like '/' , '|' ?

Thank you for any help

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Bas van de Sande Profile Picture
    4,383 on at

    What you can do is the following:  Use the Advanced Find within CRM.  There you can create the query. Press the "FetchXML download" button  and there you have the FetchXML needed :)

  • Suggested answer
    Rajkumar Rajaraman Profile Picture
    on at

    Hi Asgur,

    Refer the following links:

    social.microsoft.com/.../crm-2013-c-plugin-working-with-fetchxml-query

    www.resultondemand.nl/.../273dd192-cc12-4ab0-84ec-1ea1b8f367c3.htm

    Hope this helps.

    Regards,

    R. Rajkumar

  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at

    advanced find is best option to generate fetchxml..

    and you can convert your sql into fetchxml by using

    http://www.sql2fetchxml.com/

    Hope this will help

  • Verified answer
    Royal King Profile Picture
    27,686 on at

    you could use fetchxml builder tool from Xrmtoolbox to build query and test result before using it in the code

    https://fxb.codeplex.com/

  • Community Member Profile Picture
    on at

    Thank you, guys !

    I've just tried to use fetchxml builder - pretty nice tool!

    PS

    I didn't try Advanced search because it wasn't set on my server , maybe I missed something.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans