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)

Using Linked-Entity in addCustomFilter

(0) ShareShare
ReportReport
Posted on by 25

At this moment I know how to use the addCustomFilter in combination with addPreSearch (and the remove variants). All this works perfectly when passing a filterXml like:

    <filter type="and">
      <condition attribute="name" operator="eq" value="test123" />
    </filter>

But I just can't figure out how to use linked-entities in the addCustomFilter and whether it is actually possible. I've tried the following:

    <link-entity name="account" from="accountid" to="parentaccountid">
      <filter type="and">
        <condition attribute="name" operator="eq" value="test123" />
      </filter>
    </link-entity>

It is still the same filter but it is now placed on the parent account of the account. With this filterXml I want to get all the accounts that have the account 'test123' as the parent account.

The problem is that the filter doesn't work in the addCustomFilter but it does return results in the AdvancedFind.

Is there a way to use linked-entities in the addCustomFilter method, if so what am I doing wrong?

*This post is locked for comments

I have the same question (1)
  • Hosk Profile Picture
    on at

    To get the right text for link entities, the best way is to create an advanced of the search you want to do and then click the download Fetch XML button

    this will then give you a copy of the fetch XML and the link entity.

  • Ferdy Griffioen Profile Picture
    25 on at

    @Ben Hosking:

    You can not pass the entire fetchXML to the addCustomFilter, it must be the filterXML part.

    I've tried to make correct fetchXML with linked-entities and then take the filterXML part, but it doesn't work

  • LIONEL TEULIERES Profile Picture
    70 on at

    have you find a solution?

  • Ferdy Griffioen Profile Picture
    25 on at

    Unfortunately I haven't.

  • Community Member Profile Picture
    on at

    Have you tried this:

    <link-entity name="account" from="accountid" to="parentaccountid" link-type="outer">

    <filter... etc

  • Ferdy Griffioen Profile Picture
    25 on at

    @ Adam Vero,

    As I've state before, the XML you pass must start with 'filter'. Therefor I can't try your idea as it starts with 'link-entity'.

  • BiR Profile Picture
    180 on at

    Have you found a solution?

    I am trying to do exactly the same.

  • BiR Profile Picture
    180 on at

    I have also created a stackoverflow for your question:

    stackoverflow.com/.../using-linked-entity-in-addcustomfilter

  • Suggested answer
    Linn Zaw Win Profile Picture
    3,407 on at

    If the out of the box addCustomFilter method doesn't work for link entity conditions, try this custom addCustomFilter method

    madcomputerist.blogspot.com/.../adding-additional-condition-to-lookup.html

  • CU20091903-0 Profile Picture
    55 on at

    Hi Ferdy

    I am also faced with the exact same issue and I can't seem to crack it.

    Have you managed to find a solution for this yet?

    Kind Regards

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