Hi all
I have 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'>"+
"<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-type='inner'>"+
" <link-entity name='account' from='accountid' to='customerid' alias='az' link-type='inner'>"+
" <filter type='and'>"+
" <condition attribute='accountid' operator='eq' uiname='"+AccountName+"' uitype='account' value='"+currentleadId+"' />"+
" </filter>"+
" </link-entity>"+
" </link-entity>"+
" </entity>"
"</fetch>"
var contactRecords = XrmServiceToolkit.Soap.Fetch(contactFetchXML);
if (contactRecords.length > 0)
{
if (contactRecords[0].attributes.extendedamount!= undefined)
alert(contactRecords[0].attributes.extendedamount.value);
}
}
This code is working well I want to fill these attribute values in a sub grid
How can I done this?