Hi Guys,
I have a requirement to do a filter on lookup field on a subgrid, I found a couple of resources online, but I have a very small doubt in that code.
Here's the code I found.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
//www.bobylog.com
var filterXML = [
'<filter type="and">',
'<condition attribute="statecode" value="0" operator="eq"/>',
'<condition attribute="attr2" operator="eq" value="{75a9fde0-a559-4fe1-94ec-215a8d15efb9}"/>',
'</filter>'
].join('\n');
document.getElementById("sampleSubGrid").addEventListener("click", function () {
setTimeout(function () {
var gridControl = Xrm.Page.getControl("sampleSubGrid");
var me = gridControl.$c_0.$N_4.$Y_3;
me.addPreSearch(function () {
me.addCustomFilter(filterXML);
});
}, 2000);
});
|
But I'm not sure which lookup this line points to "gridControl.$c_0.$N_4.$Y_3", I have multiple lookups on my grid I only want to filter one of them.
Please help me out here.
Thanks,
Vinod
*This post is locked for comments