Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Fill sub grid using filtered values

$
0
0

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?


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>