I use this code
function accountOnload() {
debugger;
var contactFetchXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
" <entity name='salesorderdetail'>"+
" <attribute name='productid' />"+
" <attribute name='priceperunit' />"+
" <attribute name='quantity' />"+
" <attribute name='extendedamount' />"+
" <attribute name='salesorderdetailid' />"+
" <attribute name='manualdiscountamount' />"+
" <order attribute='productid' descending='false' />"+
" <link-entity name='salesorder' from='salesorderid' to='salesorderid' alias='ay'>"+
" <link-entity name='account' from='accountid' to='customerid' alias='az'>"+
" <filter type='and'>"+
//" <condition attribute='accountid' operator='eq' uiname='Warind Traders' uitype='account' value='{8F3E4A08-1263-E611- //80C0-308D99276D29}' />"+
" </filter>"+
" </link-entity>"+
" </link-entity>"+
" </entity>"
var contactRecords = XrmServiceToolkit.Soap.Fetch(contactFetchXML);
if (contactRecords.length > 0)
{
if (contactRecords[0].attributes.quantity!= undefined)
alert(contactRecords[0].attributes.quantity.getvalue);
}
}
It give me an undefined value
Why?
need help.