cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

expand does not seem to work

The Expand Query does not seem to create the join as it should. Is it my syntax?  Does it work currently? Capture.PNG

 

Are there other options?  It would be so wonderful if a view could be used here.

3 REPLIES 3
v-micsh-msft
Community Support
Community Support

Hi @Anonymous,

 

Please check the following documentation for the Expand usage:

OData system query options using the OData endpoint

"

Directs that related records should be retrieved in the record or collection being retrieved.

If you want to retrieve related records, locate the name of the entity relationship that defines this relationship. You may have to view the entity relationship information in the application to correctly identify the relationship or the conceptual schema definition language (CSDL) for the Organization Data Service.

For example, to retrieve opportunity records related to accounts, use the opportunity_customer_accounts entity relationship. The query /AccountSet?$expand=opportunity_customer_accounts returns the opportunity records and the account records.

"

Testing results:

78.PNG

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Still seems to not work for me

Capture.PNG

 

{
  "status": 400,
  "message": "{\r\n  \"code\": \"\",\r\n  \"message\": \"Could not find a property named 'opportunity_customer_accounts' on type 'Microsoft.Dynamics.CRM.opportunity'.\",\r\n  \"innererror\": {\r\n    \"message\": \"Could not find a property named 'opportunity_customer_accounts' on type 'Microsoft.Dynamics.CRM.opportunity'.\",\r\n    \"type\": \"Microsoft.OData.Core.ODataException\",\r\n    \"stacktrace\": \"   at Microsoft.OData.Core.UriParser.Parsers.SelectExpandBinder.GenerateExpandItem(ExpandTermToken tokenIn)\\r\\n   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\\r\\n   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\\r\\n   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.SelectExpandBinder.Bind(ExpandToken tokenIn)\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.SelectExpandSemanticBinder.Bind(IEdmStructuredType elementType, IEdmNavigationSource navigationSource, ExpandToken expandToken, SelectToken selectToken, ODataUriParserConfiguration configuration)\\r\\n   at Microsoft.OData.Core.UriParser.ODataQueryOptionParser.ParseSelectAndExpandImplementation(String select, String expand, ODataUriParserConfiguration configuration, IEdmStructuredType elementType, IEdmNavigationSource navigationSource)\\r\\n   at Microsoft.OData.Core.UriParser.ODataQueryOptionParser.ParseSelectAndExpand()\\r\\n   at System.Web.OData.Query.SelectExpandQueryOption.get_SelectExpandClause()\\r\\n   at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.ThrowIfExpandWithRefForNonLookupNavProp(ODataQueryOptions queryOptions, String edmEntityName)\\r\\n   at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.RetrieveEdmEntityCollection(CrmODataExecutionContext context, String entityCollectionName, String castedEntityName, ODataQueryOptions queryOptions)\\r\\n   at Microsoft.Crm.Extensibility.OData.EntityController.GetEntitySetInternal(String entitySetName, String castEntityName, CrmODataExecutionContext context, CrmEdmEntityObjectCollection crmEdmEntityObjectCollection, ODataQueryOptions queryOptions)\\r\\n   at Microsoft.Crm.Extensibility.OData.EntityController.GetEntitySet(String entitySetName)\\r\\n   at lambda_method(Closure , Object , Object[] )\\r\\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\\r\\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\\r\\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"\r\n  }\r\n}",
  "source": "shellcfcrm.crm.dynamics.com",
  "errors": [],
  "debugInfo": "clientRequestId: 6a43b30c-3bb6-49e8-95d3-926d6cb115ca"
}

Hi,

 

I am facing same issue when i try to fetch the child entity record on the basis of parent ID, sometime it search the property on child entity and sometimes on parent, here is the message :-

 

"Could not find a property named 'child entity property' on type 'Parent Entity.",
 
Error.JPG

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Kudoed Authors
Users online (3,149)