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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Web Api queries using fetchXml and aliases suddenly stopped working

(0) ShareShare
ReportReport
Posted on by

Hi all,

We have some queries against the D365 v9.0 api that use fetchXml that have suddenly stopped working today or over the weekend without any code changes.  The fetchXml joins the Account table to itself using aliases, and the aliases are used in the '$select' portion of the api call as well, but today we're getting the error:
"Can not resolve the segment identifier 'aliasname.fieldname' in query option".  Anyone know what might be going on?  Was something changed on the back-end that would break this?

For example, the fetchXML may look something like this:

	
		
		
		
		
			
		
		
			
			
			
				
				
			
		
	


and the api call would look something like this:

https://xxx.dynamics.com/api/data/V9.0/accounts?$select=accountid,name,parent.name,parent.accountid,grandparent.name,grandparent.accountid&fetchXml=[data from above]

and it will fail saying:
"Can not resolve the segment identifier 'parent.name' in query option"

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    Above fetchXML looks good because when i run this on FETCHXML Builder in XRMToolbox then it shows the proper value.

    Now regarding Odata query: odata query does not support multiple link entity as shown in below screenshot:

    pastedimage1635834691328v1.png

    So, instead of Odata query please use Xrm.WebAPI,retrieveMultipleRecords as shown below:
    pastedimage1635835079774v2.png
    Code:

    
    
    var fetchXml = "" 
      "" 
        "" 
        "" 
        "" 
        "" 
          "" 
        "" 
        "" 
          "" 
          "" 
          "" 
            "" 
            "" 
          "" 
        "" 
      "" 
    "";
    
    Xrm.WebApi.retrieveMultipleRecords("account", "?fetchXml=" fetchXml).then(
        function success(result) {
            for (var i = 0; i < result.entities.length; i  ) {
                console.log(result.entities[i]);
            }                    
    
            // perform additional operations on retrieved records
        },
        function (error) {
            console.log(error.message);
            // handle error conditions
        }
    );

    Hope this helps.

    Thanks,
    Pradeep.

    Please mark this as VERIFIED, if it helps.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 192 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans