Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
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 TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
I have coded a fetch with a link-entity clause to get the value of an attribute in a related table that is working & returning the data I need [when tested using the XrmToolBox : FetchXml Tester tool].
The link-entity portion of the fetch statement is;-
"<link-entity name='new_ndisclientservice' to='new_goalitem' from='new_supitemrefnum' link-type='inner' alias='SrvItm'> " +
"<attribute name='new_costcentreid' />" +
When I run it in CRM using the XrmServiceToolkit, the FetchReturn.length = 2 (as I would expect on the basis of the criteria I am using) it is called via:-
var FetchReturn = XrmServiceToolkit.Soap.Fetch(FetchGoalNotes1Prsn(oFromDate, oToDate, oPrsnID));
So I know that the code is all OK up to that point. My issue is that when I try to get the value of new_costcentreid from the returned records the code stops running with no error message.
NB * 'new_costcentreid' is a look-up field in the 'new_ndisclientservice' entity.
To get the value of new_costcentreid I have tried various options including:-
var oCostCentre1 = FetchReturn.Attributes["new_costcentreid"].value;
var oCostCentre1 = FetchReturn.Attributes["new_costcentreid"].id;
I read another post that indicated that I needed to use the link alias so tried:-
var oCostCentre1 = FetchReturn.Attributes["SrvItm.new_costcentreid"].value;
..but that didn't work. Have tried a range of different ways but with no success - would appreciate any hints that may get this working.
Thanks in anticipation
This should work.
var oCostCentre1 = FetchReturn.attributes.SrvItm.new_costcentreid.value;
It turned out that this is how I got it to work:-
var oCostCentre1 = FetchReturn.attributes["SrvItm.new_costcentreid"].value;
...so a few variations from your suggestion:-
Business Applications communities