Posts

Showing posts with the label fetchxml

DYNAMICS 365 HOW TO EXECUTE FETCHXML QUERIES IN C#

Previously, we saw how to execute FetchXml query using Xrm.WebApi in JavaScript In this quick post, we will see how to execute FetchXml query in C# . Prepare the FetchXml you want to execute whether from the Advanced Find, or any other FetchXml generator in the community Create the C# function you want to call in order to execute the retrieve request and Copy/Paste the FetchXml query In order to be able to execute FetchXml queries in C#, you must use the FetchExpression class instead of QueryExpression as per the below public void FetchXmlInFetchExpression() { var fetchQuery = @" <fetch version='1.0' output-format='xml-platform' ma...

DYNAMICS 365 HOW TO EXECUTE FETCHXML QUERIES IN WEB.API JAVASCRIPT

In Dynamics 365, you can use WebAPI calls to retrieve data using OData queries. However, when coming to more complex queries, the OData might become complicated to be built if not impossible. Therefore, using FetchXml queries in the WebAPI call is your best option. Querying using FetchXml have more advantages from the easiness to be generated using the Advanced Find and more readable, to using joins and aggregations. In this quick post, we will see how to execute FetchXml query using Xrm.WebApi in JavaScript . Prepare the FetchXml you want to execute whether from the Advanced Find, or any other FetchXml generator in the community Prepare the JavaScript function you want to call in order to execute WebAPI request The below function is used to retrieve the user roles ...

LIMITATION NUMBER OF ALLOWED LINK ENTITY IN QUERY

Image
In this quick post, I will talk about a limitation you might face when working in D365 CE which is exceeding the maximum number of link entities in a query . The exception message that you will receive is the following: Error : Number of link entities in query exceeded maximum limit. where the maximum number of link entities is 10. You get this error in different scenarios In a view when you add fields of more than 10 related entities because they are reflected as link entities with outer join to the main entity <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">......... <Message> Invalid FetchXml on SavedQuery.Update. </Message>......... ...