Hi all
I am using this code
function accountOnload() {
debugger;
var AccountName = Xrm.Page.getAttribute('name').getValue();
var currentleadId = Xrm.Page.data.entity.getId();;
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=AccountName uitype='account' value=currentleadId />"+ // My this condition is not working it gives the result which not fulfill this condition
" </filter>"+
" </link-entity>"+
" </link-entity>"+
" </entity>"
var contactRecords = XrmServiceToolkit.Soap.Fetch(contactFetchXML);
if (contactRecords.length > 0)
{
if (contactRecords[0].attributes.extendedamount!= undefined)
alert(contactRecords[0].attributes.extendedamount.value);
}
}
Any body help to fulfill my requirement