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)

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

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