Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Will addPresearch with link-entity work

Posted on by 215

Hello,

So im trying to filter a lookup using addPreSearch, i have done it before but the fetchXml was pretty straight forward and i could use a connection between the two entities.

This is the fetch i need to use now, and i know i read somewhere that this type of fetch cannot be executed when you have a link-entity in the fetch.

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
  <entity name="new_wineregion">
    <attribute name="new_wineregionid" />
    <attribute name="new_name" />
    <attribute name="createdon" />
    <order attribute="new_name" descending="false" />
    <link-entity name="product" from="new_wineregion" to="new_wineregionid" alias="ad">
      <filter type="and">
        <condition attribute="new_vendor" operator="eq" uiname="Martin Stein" uitype="account" value="{F2183A76-A9C0-E711-80F6-000C2939F531}" />
      </filter>
    </link-entity>
  </entity>
</fetch>


Should i divert to using addCustomFilter instead? It looks a bit more messy as i need to create also the layout of the fetch...so i'm hoping i can avoid it....

Any advice is welcomed

*This post is locked for comments

  • Filip Vanchevski Profile Picture
    Filip Vanchevski 215 on at
    RE: Will addPresearch with link-entity work

    I guess i was just hoping to avoid it deep down i knew what i had to do, o well here it goes again :)

  • Verified answer
    Thomas David Dayman Profile Picture
    Thomas David Dayman 11,323 on at
    RE: Will addPresearch with link-entity work

    Hi Filip,

    Yes if you need to filter on an attribute that belongs to a linked entity. Then you have to use the addCustomFilter. Its not too messy, once you do it once you can just copy and paste the code when you need to use it again :)

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans