Applying Custom view filter on a lookup doesn't retrieve any records instead shows "0x8006088a Resource not found for the segment 'null' " in lookup view.
Code snippet used
CT.EducatedAtEntity.FilterEducationCentre = function () {
try {
var fetchxml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" + "<entity name='account'>" + "<attribute name='name'/>" + "<attribute name='accountid'/>" + "<link-entity name'ct_ct_siccode_account' from='accountid' to='accountid' link-type='inner' intersect='true' >" + "<link-entity name='ct_siccode' from='ct_siccodeid' to='ct_siccodeid' >" + "<filter type='and' >" + " <filter type='or' >" + "<condition attribute='ct_number' operator='in' >" + "<value>85100</value>" + "<value>85200</value>" + "<value>85310</value>" + "<value>85320</value>" + "<value>85410</value>" + "<value>85421</value>" + "<value>85422</value>" + "<value>85510</value>" + "<value>85520</value>" + "<value>85530</value>" + "<value>85590</value>" + "<value>85600</value>" + "</condition>" + "</filter>" + "</filter>" + "</link-entity>" + "</link-entity>" + "</entity>" + "</fetch>";
var layoutXml = "<grid name='resultset' object='1' jump='account' select='1' icon='1' preview='2'>" + "<row name='result' id='accountid'>" + "<cell name='name' width='150' />" + "</row>" + "</grid>";
CT.EducatedAtEntity.Constants.formContext.getControl(CT.EducatedAtEntity.Constants.fieldNames.educationCentre).addCustomView("{00000000-0000-0000-0000-000000000001}", "account", "Education Centres", fetchxml, layoutXml, true);
} catch (ex) {
CT.CommonUtility.ErrorHandler(ex);
}
}
Below mentioned FetchXml retrieves the result set in XRMToolBox and the same is used in the code snippet above..
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct="true" >
<entity name="account" >
<attribute name="name" />
<attribute name="accountid" />
<link-entity name="ct_ct_siccode_account" from="accountid" to="accountid" link-type="inner" intersect="true" >
<link-entity name="ct_siccode" from="ct_siccodeid" to="ct_siccodeid" >
<attribute name="ct_number" />
<filter type="and" >
<filter type="or" >
<condition attribute="ct_number" operator="in" >
<value>85100</value>
<value>85200</value>
<value>85310</value>
<value>85320</value>
<value>85410</value>
<value>85421</value>
<value>85422</value>
<value>85510</value>
<value>85520</value>
<value>85530</value>
<value>85590</value>
<value>85600</value>
</condition>
</filter>
</filter>
</link-entity>
</link-entity>
</entity>
</fetch>
Could you please suggest on how to fix the same..