Some methods I have tried that didn't work:
- doing all the filtering in javascript. This works until the User interacts with the subgrid to filter by column, and then that filter overrides the javascript FetchXML.
Here's an example of how I have tried to smuggle the GUID into the FetchXML using javascript, which hopefull I can get the Plugin to catch. However, the plugin does not seem to see the GUID.
var accountId = Xrm.Page.data.entity.getId();
Xrm.Page.getControl(/HierarchyTest/).addPreSearch(function() {
addCustomFilterToSubgrid(accountId);
});
}
var fetchXml = /<filter><condition attribute='new_account' operator='eq' value='/ + accountId + /' /></filter>/;
Xrm.Page.getControl(/HierarchyTest/).addCustomFilter(fetchXml);
}