Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 154803

Forum Post: Lookup Custom filter error

$
0
0
Hi everyone, I am trying to apply a custom filter to a contact lookup based on a related entity. I am using the addPreSearch and addCustomFilter functions and from what i have seen in various forum it looks like it should be working but whenever i try to test it an error occurs in the console. There error in the console: "Uncaught TypeError: $v_5 is not a function at global.ashx?ver=1149864775:4020 at Mscrm.TurboForm.Control.ViewModel.LookupViewModel.$DW_5 (JsProvider.ashx?bundle=FormControlBundle&ids=1223231347-405283869:21718) at Mscrm.TurboForm.Control.ViewModel.LookupViewModel.issueLookupSearch (JsProvider.ashx?bundle=FormControlBundle&ids=1223231347-405283869:21723) at Mscrm.TurboForm.Control.View.LookupEditElement.showSearchResults (JsProvider.ashx?bundle=FormControlBundle&ids=1223231347-405283869:28514) at Mscrm.TurboForm.Control.View.LookupEditElement.$Il_2 (JsProvider.ashx?bundle=FormControlBundle&ids=1223231347-405283869:29224) at HTMLInputElement. (MicrosoftAjax.js?ver=1149864775:24) at HTMLInputElement.b (MicrosoftAjax.js?ver=1149864775:2922)" The main parts of the code: function PreFilter() { if (Xrm.Page.getAttribute("fieldname").getValue() != null) { Xrm.Page.getControl("fieldname").addPreSearch(addLookupFilter()); } } ...after getting the id's required for the filter: var fetchXml = " "; fetchXml = fetchXml + " "; for (var j = 0; j {" + tenants[j]["id"].toUpperCase() + "} "; } fetchXml = fetchXml + " "; fetchXml = fetchXml + " "; Xrm.Page.getControl("field").addCustomFilter(fetchXml, "contact"); I have used alerts in the script to see where it gets to and what the fetchXml looks like and it all seemed okay to me, this is an example of what its returned: {1300A5B9-83FD-E311-80C1-0050568F0035} {8500A5B9-83FD-E311-80C1-0050568F0035} If anyone could tell me why i am getting this error, it would be greatly appreciated.

Viewing all articles
Browse latest Browse all 154803

Trending Articles



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