Check out the latest features available in Dynamics 365 for Customer Engagement, including LinkedIn Connect, Voice of the Customer and Universal Resource Scheduling.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
I have a FetchXML query that works in an SSRS report but fails in the Advanced Find. (CRM 2016 On Premise) I am using the View Designer within the XRMtoolbox tool.
I am starting at the Activity and bringing in all Contacts that are equal to an attribute on the contact form. Good so far. I then want to add any opportunity related to those contacts where the parent is the Contact record. I can display the results in the query window just fine. I can run this in an SSRS just fine. It just won't run in the Advanced Find in CRM.
I am unsure what is wrong unless the View Designer is not saving to CRM correctly?
Here is what happens when I display columns on the advanced find add columns window. Entire Fetch below.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" count="50" >
<entity name="activitypointer" ><attribute name="activitytypecode" /><attribute name="subject" /><attribute name="statecode" /><attribute name="prioritycode" /><attribute name="modifiedon" /><attribute name="activityid" /><attribute name="instancetypecode" /><attribute name="community" /><attribute name="createdon" /><attribute name="regardingobjectid" /><attribute name="ownerid" /><order attribute="modifiedon" descending="false" /><link-entity name="contact" from="contactid" to="regardingobjectid" alias="ax" ><attribute name="address1_postalcode" /><attribute name="parentcustomerid" /><attribute name="lastname" /><attribute name="sl_isvip" /><attribute name="telephone2" /><attribute name="fullname" /><attribute name="firstname" /><attribute name="sl_issrexecutive" /><attribute name="emailaddress1" /><attribute name="address1_city" /><attribute name="telephone1" /><filter type="and" ><condition attribute="new_KeyFieldForContact" operator="not-null" /></filter><link-entity name="opportunity" from="parentcontactid" to="contactid" alias="ai" visible="true" ><attribute name="campaignid" /><attribute name="new_verbaltotal" /><attribute name="sl_opportunitytype" /><filter type="and" ><condition attribute="campaignid" operator="not-null" /></filter></link-entity></link-entity></entity></fetch>
Can you please provide layout xml? I believe you have wrong alias used inside. Try to replace that column you have issues with with ai.sl_opportunitytype.
Hi Andrill, my XML is in the post unless what I provided is not what you need?
remove that column and add it again (not from FetchXml, but from the columns - modify that view right in CRM.. btw, that's what Andrii was implying, I believe). It seems you have changed the alias in that fetch along the way, so it's still trying to find that numeric alias, and you have it as "ai" now.
Yes, I tried that but when I put the columns back they don't display the data in the Advanced Find. I am looking for all Activities related to Contacts and Opportunities from 3 different views. I can get the activities and contact columns to display but when I add the opportunity columns they do not display.
It works in an SSRS report but the Advanced Find does not seem to like they way the XML query is formatted.
Normally, advanced find can only go two levels deep (as far as columns are concerned) - columns from the main and related entities can be displayed, but you can't go beyond that.. maybe that's the problem, since you are trying to display an attribute from the "3d" level..
Not sure if that would work for you, but you might try to start from the "contacts" and link opportunities/activities to the contacts.
PS. Either way, the reason you are getting that original error is because there is a different alias/column name now, so it has to be updated this way or another..
Alex - Thanks, it is a 3rd level entity issue. I just thought I could sneak by with a FetchXML imported back in to the Advanced Find. I can pull an SSRS report and everything displays as needed.
That will have to do for my users, just trying to go above and beyond for them with this one..:)
Business Applications communities