Hi Expert,
I have two entities one is the "project hub" another is "taskassignments" the relationship is 1:N. Today I use the FetchXML to get the value of the column. I can get some the value of the column, but there are two values of the columns that cannot be fetched and I got the error message like "undefined". I list my fetchXML as below and I am sure that the XML is correct because I give it a try by using XMLCRMTools.
so how should I sort it out? do you all have a solution..??
var fetchXML = "<fetch top='50'><entity name= 'new_dceprojecttasksassign'><attribute name='new_dcprojectstagenumber'/><attribute name='new_name'/><attribute name='new_dcprojectactualbegindate'/><attribute name='new_dcprojectactualenddate'/><attribute name='new_dcprojectprincipal'/><attribute name='new_dccomppercent' /><attribute name='new_dcprojecttaskstitle' /><order attribute='new_dcprojectstagenumber' /><filter type='and'><condition attribute='new_dcprojecttitle' operator='eq' value='" + window.parent.Xrm.Page.data.entity.getId() + "'/></filter></entity></fetch>";
var getResults = new Array();
getResults = XrmServiceToolkit.Soap.Fetch(fetchXML);for (var i = 0; i < getResults.length; i++)
{
alert(getResults[i].attributes["aa.new_dcprojectstagenumber"].value); --> OK
alert(getResults[i].attributes["aa.new_name"].value); --> OK
alert(getResults[i].attributes["aa.new_dcprojectactualbegindate"].value); --> OK
alert(getResults[i].attributes["aa.new_dcprojectactualenddate"].value); --> OK
alert(getResults[i].attributes["aa.new_dcprojectprincipal"].value); --> Something went wrong (undefined). It's a lookup field to look for the User entity.
alert(getResults[i].attributes["aa.new_dccomppercent"].value); --> Something went wrong (undefined). It's a type of the whole number.
alert(getResults[i].attributes["aa.new_dcprojecttaskstitle"].value); --> don't run because it leave the for loop.
}