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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Custom FetchXML query, column not shown in view?

(0) ShareShare
ReportReport
Posted on by 65

I have created a FetchXML query which, doe to the join types it seems can only be developed and ran in XrmTooBbox. The query is designed to show me all opportunities that are related to accounts that are shared with 'me', and this partb nof it works well. I also need to display the current sales process stage name in the view so this is included in the following query and seems to produce the desired result.

Dynamics 365 cloud based, version 9.1.0000.21347

Here is the fetch XML:

<fetch version="1.0" output-format="xml-platform" mapping="logical" count="50" >
<entity name="opportunity" >
<attribute name="name" />
<attribute name="estimatedvalue" />
<attribute name="estimatedclosedate" />
<order attribute="estimatedclosedate" descending="false" />
<order attribute="cpc_weightedrevenue" descending="false" />
<filter type="and" >
<condition attribute="statecode" operator="eq" value="0" />
</filter>
<attribute name="cpc_deliverydate" />
<attribute name="ownerid" />
<attribute name="cpc_projecttype" />
<attribute name="cpc_weightedrevenue" />
<attribute name="cpc_estimatedclosureyear" />
<attribute name="cpc_estimatedclosuremonth" />
<attribute name="cpc_estimateconversiondate" />
<attribute name="cpc_liklihoodofconversion" />
<attribute name="parentaccountid" />
<attribute name="opportunityid" />
<link-entity name="account" from="accountid" to="parentaccountid" >
<link-entity name="principalobjectaccess" from="objectid" to="accountid" link-type="inner" >
<link-entity name="systemuser" from="systemuserid" to="principalid" link-type="inner" >
<filter type="and" >
<condition attribute="systemuserid" operator="eq-userid" />
</filter>
</link-entity>
</link-entity>
<!--<attribute name="name" />-->
</link-entity>
<link-entity name="opportunitysalesprocess" from="opportunityid" to="opportunityid" >
<attribute name="activestageid" alias="CurrentStage" />
</link-entity>
</entity>
</fetch>

Problem is, if I use this in XrmToolBox View designer, no value is shown for the 'CurrentStage' (alias) column and I can't see why.

Is this is a limitation of dynamics CRM or can anyone suggest a better/alternative way to get the desired result?

Many thanks

Chris.

I have the same question (0)
  • Suggested answer
    LuHao Profile Picture
    40,892 on at

    Hi Chris,

    You will need to select columns in the View Designer, then save and publish.

    I also created an opportunity view, edited it in the xrm tool box to add 'CurrentStage' (alias) column in the xml.

    pastedimage1598340696001v1.png

    Then return fetchxml, select columns and select all columns, finally save and publish.

    pastedimage1598341229968v3.png

  • David Jennaway Profile Picture
    14,065 on at

    Just to clarify, is the CurrentStage returned OK when running the FetchXML query, but not showing in the view designer ? If so, try adding an alias for the opportunitysalesprocess link-entity in the FetchXML query

  • ChrisWatson Profile Picture
    65 on at

    Thanks Hao, my issue is that while I can see the data in the query when executed and I am also able to select the field, save and publish the view, when I preview the View, there is no data for that stage field (when it IS displayed in the query preview). Any thoughts?

  • ChrisWatson Profile Picture
    65 on at

    Correct David - I've tried aliasing both the link-entity and the target attribute but the data that is shown in the FetchXML preview is not displayed on the view output (just an empty column named as per the alias(es)). Very confusing and clearly not as expected? Any more ideas would be very welcome as I wont have much hair left by the end of the day otherwise lol

  • LuHao Profile Picture
    40,892 on at

    Hi Chris,

    In my test, it had a little delay to see the change.

    Can you try to clear your browser cache or change your browser?

  • jay.han.au Profile Picture
    10 on at

    I have same issue with you.

    I can get the result for the link-entity attribute values from FetchXML builder, but when I back to View Designer, the column value is empty. I tried the alias and no way. Please let me know if you solve this issue.

    Thanks,

    Jay

  • ChrisWatson Profile Picture
    65 on at

    Hi, unfortunately not - it seems to be a limitation or bug in Dynamics 365 and I'm afraid I didn't find an alternative way to get around this. I'm sure my client will still want/need it so I expect to come back to this. No news at the moment I'm afraid.

  • Community Member Profile Picture
    on at

    Ditto - I have the same issue too. Looks like a bug with view designer. Results are displayed fine in fetchxml but blank columns in view designer. 

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans