Hello fellow CRM developers
I like the new filtered lookup feature in the new version of CRM. I use it to have one lookup filter another lookup. But it doesn't work in the BPF (business process flow). This is a known issue but there's a workaround. For a 1:N/N:1, this can easily be achieved with a filter eventhandler applied via javascript like this:
if (Xrm.Page.getControl("header_process_new_product") != null) {
Xrm.Page.getControl("header_process_new_product").addPreSearch(addFilterProductHeader);
}
function addFilterProductHeader() {
var filter = " <filter type='and'>";
filter += " <condition attribute='new_casetype' operator='eq' value='id_of_filtering_field' />";
filter += " </filter>";
Xrm.Page.getControl("header_process_new_product").addCustomFilter(filter);
}
However this doesn't work for a N:N relationship. A lookup that filters another lookup (and the relationship between the two entities is N:N not 1:N).
Example:
I have many "Case Products" which can have many "Case Solutions", and vice versa. A N:N in other words. I can use the new filtered lookup option on form, but not in the BPF.
Is there any workaround for this?
*This post is locked for comments