CRM 2013 – When using FetchXML is better than OData

Hosk's Dynamic Blog

“Ordinary people think merely how they will spend their time, a man of intellect tries to use it.” – Schopenhauer

I had a tricky problem where I need to select a lot of fields from an entity which was riddled with duplicates.

The oData query was bringing 1525 rows but after getting rid of the duplicates I was left with 25 rows!

OData  has no distinct

So why was the OData query bringing back so many rows because there is no distinct.  So the code was retrieving lots of data, it was then removing the duplicates.  It was a lose/lose scenerio

  • longer retrieve with more data
  • more time spent on getting rid of the extra data we didn’t need

I needed to clarify is there is no way to retrieve a distinct set using OData.  I looked on the internet and SDK but there is no distinct function with OData

FetchXML

View original post 512 more words

Published by Sreeni Pavalla

Working as a Assistant Technical Manager in Positive Edge Technologies. Having over 11 years of extensive hands-on experience in MS Dynamics CRM 4.0, 2011, 2013, 2015, 2016, Dynamics 365 with over 5 years of experience in CRM Online. You can visit my blog here https://sreenipavalla.me/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: