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 365 | Integration, Dataverse...
Answered

Plugin - Which query to use - fetchxml or Linq?

(0) ShareShare
ReportReport
Posted on by 1,577

Hello,

I am seeking some advice. - I am writing a CRM (Dynamics365 online) Plugin on pre-Create of a Lead.

Central to this is a (retrievemultiple) query to find out if leads already exist in CRM with the same details (email, name) as the incoming Lead.

I will then use attribute-values from the entities in this resultset in order to update the new/incoming Lead.

In terms of speed/efficiency, future-proofing and (less-so) ease of use, would you recommend I use fetchxml for this query, or Linq, or any other alternative?

Also, am I better to use late or early-binding - is there any performance advantage in either?

Many thanks for advice.

- Seamus

I have the same question (0)
  • Verified answer
    Ram Prakash Duraisamy Profile Picture
    2,287 on at

    Hi Seamus,

    Please find the performance order which we can use for Retrieve Multiple

    1.QueryExpression

    2.Linq

    3.Fetchxml

  • Seamus Profile Picture
    1,577 on at

    Thanks Ramprakash. So, fetchxml is the "worst"? Any advice of later or early binding, or is there no difference?

  • Verified answer
    Charles Abi Khirs Profile Picture
    3,569 on at

    Hello,

    I don't think there is better statement than the other, because they are all reflected as SQL statements on the database level. However, the way you write your query and what you want to achieve with it might impact the performance, like aggregation, retrieving all columns instead of only the needed ones, or not using linked entities when needed.

    As for early bound and late bound, it doesn't impact the performance because it is a way of writing the code where I prefer to use early bound because it gives you the intellisence and you can avoid the typo errors that can be present in using late bound.

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 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans