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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

API OData query through Exception - 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.

(0) ShareShare
ReportReport
Posted on by 12

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

I have the same question (0)
  • Community Member Profile Picture
    on at

    hello,

    I also get this issue from CRM Web API. We recently migrate to V9.

    Any idea ?

  • Suggested answer
    manojpatil5288 Profile Picture
    12 on at

    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

  • Suggested answer
    SCV Profile Picture
    1,004 on at

    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.

  • manojpatil5288 Profile Picture
    12 on at

    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,

     manoj

  • Community Member Profile Picture
    on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans