web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Field Service forum / Resco Woodford / Field...
Field Service forum

Resco Woodford / Field Service Mobile App: View Filter exceeds number of linked entities in query

(0) ShareShare
ReportReport
Posted on by 652

Hi,

I have created a view filter, which queries at least 5 entities - at least I can see 5 entities, maybe there are more, which I cannot see technically.

What is the limit of linked entities?

How can I circumvent the number of linked entities - maybe via some advanced XML?

If so, what does such pattern/principle look like?

Cheers

I have the same question (0)
  • Fannie30 Profile Picture
    2,990 Moderator on at

    Tino,

    My first question would be to understand the requirement.  What entity are you on and what are you trying to get to?

  • Thomas David Dayman Profile Picture
    11,323 on at

    I tested in woodford and you can definitely query more than 5 entities

  • Tino Rabe Profile Picture
    652 on at

    Hi,

    this ist the FetchXML of the query.

    I extracted the FetchXML directly form Woodford.

    The query works like a charm in Dyn365, but crashes in Woodford.

    What am I trying to achieve?

    The booked reesource of a work order shall see a list of customer assets of his personal open word orders of today, so he can load the truck with the required assets from the warehouse.

    So, I query:

    - Customer Assets

      - that are associated in work orders with certain incident types

         - which are booked for today

            - and where my system user is the bookable ressource of that work order

    <?xml version="1.0" encoding="utf-8"?>

    <fetch xmlns:xsi="www.w3.org/.../XMLSchema-instance&quot; xmlns:xsd="www.w3.org/.../XMLSchema&quot; version="1.0">

     <entity name="msdyn_customerasset">

       <link-entity name="msdyn_workorder" alias="L0" from="msdyn_customerasset" to="msdyn_customerassetid" link-type="inner">

         <filter type="and">

           <condition attribute="msdyn_systemstatus" operator="eq" value="690970001" />

           <filter type="or">

             <condition attribute="msdyn_primaryincidenttype" operator="eq" value="3d077b00-47ac-e811-a968-000d3ab982f2" uitype="msdyn_incidenttype" uiname= [...cut...] />

             <condition attribute="msdyn_primaryincidenttype" operator="eq" value="8dea4ad4-47ac-e811-a968-000d3ab982f2" uitype="msdyn_incidenttype" uiname=[...cut...] />

           </filter>

         </filter>

         <link-entity name="bookableresourcebooking" alias="L1" from="msdyn_workorder" to="msdyn_workorderid" link-type="inner">

           <filter type="and">

             <condition attribute="starttime" operator="today" />

           </filter>

           <link-entity name="bookableresource" alias="L2" from="bookableresourceid" to="resource" link-type="inner">

             <link-entity name="systemuser" alias="L3" from="systemuserid" to="userid" link-type="inner">

               <filter type="and">

                 <condition attribute="systemuserid" operator="eq-userid" />

               </filter>

             </link-entity>

           </link-entity>

         </link-entity>

       </link-entity>

     </entity>

    </fetch>

  • Thomas David Dayman Profile Picture
    11,323 on at

    Looks like a standard view to me. If it works in Dy365 then it might be to do something with your sync filters?

    Have you tested the view in online and offline mode? Do you get a sync errors?

  • Tino Rabe Profile Picture
    652 on at

    Hi Thomas,

    Sync filters are not applied to the linked entities except work orders.

    The hint with online/offline mode brings me a step closer:

    - running in online mode, the view crashes

    - running in offline mode, at least one record is returned (the view actualy returns two records in CRM).

    Any furher ideas?

    I really appreciate your help here.

  • Thomas David Dayman Profile Picture
    11,323 on at

    I would say take a screenshot of your sync filter for the work order for future reference, then just delete it for the purpose of seeing if this view really works. You can always add it back

    Its strange that the view doesnt work online. When you mean crash, does the mobile app close by itself?

  • Fannie30 Profile Picture
    2,990 Moderator on at

    Also take a look at your crash logs if you’re on the windows version. I can point you to where to find them if necessary.

  • Tino Rabe Profile Picture
    652 on at

    I cleared the sync filter from the work order entity, but that did not help.

    Scott, thanks for the hint, which directed me to the error logging within the Windows Application.

    Please find the error log, which I can provoke everytime I run the view:

    OnlineError 2019-01-25T22:55:15.4171219+01:00

    Serverfehler: Number of link entities in query exceeded maximum limit.

    RescoSoapException: Serverfehler: Number of link entities in query exceeded maximum limit.

    at MobileCrm.Data.WebService.WebServiceBase.ThrowSoapException(Net.HttpException ex)

    at MobileCrm.Data.WebService.WebServiceBase.XmlResponse..ctor(context, soap, Data.WebService.WebServiceBase webService, XmlReaderSettings xmlSettings, processMultipartResponses)

    at MobileCrm.Data.WebService.Crm2011.CrmService2011.<ExecuteFetch>d__48.MoveNext()

    at MobileCrm.Data.Online.LoadRequest.Execute(Data.WebService.ICrmService service)

    at MobileCrm.Data.Online.OnlineRepository.RequestThread()

    <soap>Code.Value=s:Sender| Detail.OrganizationServiceFault.ActivityId=[...cut...]| Detail.OrganizationServiceFault.ErrorCode=-2147204339| Detail.OrganizationServiceFault.ErrorDetails.ApiExceptionSourceKey=Plugin/Microsoft.Crm.ObjectModel.CustomBusinessEntityService| Detail.OrganizationServiceFault.ErrorDetails.ApiOriginalExceptionKey=Microsoft.Crm.CrmException: Number of link entities in query exceeded maximum limit. ---> Microsoft.Crm.CrmException: Number of link entities in query exceeded maximum limit.

    at Microsoft.Crm.Query.DeserializeFetchVisitor.Visit(LinkEntityExpression link)

    at Microsoft.Crm.Query.DeserializeFetchVisitor.Visit(EntityExpression entity)

    at Microsoft.Crm.Query.EntityExpression.<>c__DisplayClass130_0.<InternalDeserializeFromFetchXml>b__0()

    at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)

    at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)

    at Microsoft.Crm.Query.EntityExpression.FromSdkQueryVisitor.Visit(FetchExpression query)

    at Microsoft.Crm.Query.EntityExpression.InitializeFromQuery(QueryBase query)

    at Microsoft.Crm.Query.EntityExpression.Converter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)

    at Microsoft.Crm.BusinessEntities.ConversionHelpers.Convert(ICrmConversionContext conversionContext, Object source, Type destinationType)

    at Microsoft.Crm.Extensibility.DictionaryMapper.Map(ParameterCollection inputs, ICrmConversionContext context)

    at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)

    at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)

    at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)

    --- End of inner exception stack trace ---

    at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)

    at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)

    at Microsoft.Crm.Extensibility.Pipeline.<>c__DisplayClass2_1.<Execute>b__0()| Detail.OrganizationServiceFault.ErrorDetails.ApiStepKey=(...cut...]| Detail.OrganizationServiceFault.ErrorDetails.ApiDepthKey=1| Detail.OrganizationServiceFault.ErrorDetails.ApiPluginSolutionNameKey=System| Detail.OrganizationServiceFault.Timestamp=2019-01-25T21:55:17.2356457Z| Detail.OrganizationServiceFault.ExceptionRetriable=false| Detail.OrganizationServiceFault.InnerFault.Timestamp=2019-01-25T21:55:17.2366462Z</soap>

    -----------------------------

  • Fannie30 Profile Picture
    2,990 Moderator on at

    Are you able to provide a screenshot of the filter on the view?

  • Tino Rabe Profile Picture
    652 on at

    Sure, please find attached:

    FSMA_5F00_View.jpg

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Field Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans