Hello,
When executes API get query from Javascript returns exception .
Following is the sample query:
http://domainname/xxxx/api/data/v8.0/sub_entityName(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)?$select=_sub_FieldName_value
Exception:
{ "error":{ "code":"","message":"The type 'BadAmbiguousElementBinding:.' does not inherit from and is not a base type of 'BadAmbiguousElementBinding:.'. The type of 'KeySegments' must be related to the Type of the EntitySet.", "innererror":{ "message": "The type 'BadAmbiguousElementBinding:.' does not inherit from and is not a base type of 'BadAmbiguousElementBinding:.'. The type of 'KeySegments' must be related to the Type of the EntitySet.", "type":"Microsoft.OData.Core.ODataException","stacktrace":" at Microsoft.OData.Core.UriParser.ExceptionUtil.ThrowIfTypesUnrelated(IEdmType type, IEdmType secondType, String segmentName)\r\n at Microsoft.OData.Core.UriParser.Semantic.KeySegment..ctor(IEnumerable`1 keys, IEdmEntityType edmType, IEdmNavigationSource navigationSource)\r\n at Microsoft.OData.Core.UriParser.Parsers.SegmentKeyHandler.CreateKeySegment(ODataPathSegment segment, KeySegment previousKeySegment, SegmentArgumentParser key, ODataUriResolver resolver)\r\n at Microsoft.OData.Core.UriParser.Parsers.SegmentKeyHandler.TryCreateKeySegmentFromParentheses(ODataPathSegment previous, KeySegment previousKeySegment, String parenthesisExpression, ODataPathSegment& keySegment, Boolean enableUriTemplateParsing, ODataUriResolver resolver)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.TryBindKeyFromParentheses(String parenthesesSection)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.TryCreateSegmentForNavigationSource(String identifier, String parenthesisExpression)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.CreateFirstSegment(String segmentText)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.ParsePath(ICollection`1 segments)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathFactory.BindPath(ICollection`1 segments, ODataUriParserConfiguration configuration)\r\n at Microsoft.OData.Core.UriParser.ODataUriParser.Initialize()\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath, ODataUriResolverSetttings resolverSettings, Boolean enableUriTemplateParsing)\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath)" } } }
Kindly suggest any solution . Any kind of help will be appreciable.
Thank you.
*This post is locked for comments
It's seem this error occurred randomly. My web Api calls are made from an external application based on java, and this app works almost a year ago. I noticed this error after we migrated to V9, and sometimes when I retry the same call it works.
Hello SCV,
Thank you for response.
Yes, I have created query using Rest Builder. It works properly on Development & UAT environment. It happens on Production, but this is not continues behavior,it work sometimes and fails sometimes (like if generate request for 10 times the it will fails at 2/3 time).
Regards,
Hi Manoj,
Did you build this query using REST Builder? If so did it work there? If not I would suggest you to build and test the query using REST builder to make sure the query is alright.
Hello kfranck
,
Still unable to find out the reason. Just has one guess that it is may be connectivity issue through API.
I am used another way to fetch data using OrganizationData.svc and it works for me. Please check below sample organizationData.svc query.
http://[OrganizationBaseUrl]/[organizationaneme]/XRMServices/2011/OrganizationData.svc/entityNameSet?$select=[selectFieldListWithCommaSeperate]&$filter=[idfieldName] eq guid'[XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX]'
Thanks
manojpatil5288
hello,
I also get this issue from CRM Web API. We recently migrate to V9.
Any idea ?
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6