Monday, 11 January 2016

Difference between FetchXML and QueryExpression

To Query MS CRM DB there are the two distinct ways.
  • Using QueryExpression
  • Using FetchXML
Limitation of the QueryExpression is , If you are Querying CRM DB using QueryExpression you cannot able to set Related Entity columns as filter criteria or 
to provide a column of a linked entity to be returned as the query result.
So you are not able to execute a query similar to the following
Select Opportunity.name, Opportunity.estimatedvalue, Account.address1_city from FilteredOpportunity Opportunity
Inner join
FilteredAccount Account on Opportunity.customerid = Account.accountis
Where account.address1_country = “US”
Also you cannot use aggregate functions in query expression.
In Fetch Xml Query you can retrieve the columns of related entity and you can set the related entity columns  as filter criteria and you can use the aggregate functions in Fetch Xml query.
Query Expression can only be used in server side language i.e C#.
But Fetch Xml query can only be used in SSRS , JavaScript(Webapi),C#.
But in performance  Query Expression is better than Fetch Xml query. 



1 comment:

  1. Nice blog

    To more info look into below

    https://prudvihub.blogspot.com/2020/09/fetchxml-and-queryexpression-in.html?m=1

    ReplyDelete

Read only field , get latest value from read only field in in power app portal

Below line is used to make field readonly in power app portal through js $( "#bdo_relationshiprole_name" ).parent().css( "po...