I discovered today an interesting customization which might interest some readers. One of our Engineers suggested that this might be possible and not surprisingly it is (our Engineers are usually right).
Normally (ie. in the Customization User Interface) you can’t modify the criteria of a Lookup View. You just get stuck with all the records for that entity. However the FetchXML (one of CRM’s query languages) for that ‘default query’ is exposed in the Import/Export XML.
Simply export the entity which you want to modify the lookup for. Then look for the Lookup View. In the example below this can be found on line 47. The gotcha here is that the name sub element is at the bottom of the saved query element. Now look for the fetchxml element (row 4) and make some changes! In this example I added a condition which says that all Accounts must have an accountnumber = 100 (unrealistic I know – but it illustrates the point). Once you have made the changes then import the entity back in and publish it.

This posting is provided "AS IS" with no warranties, and confers no rights.
Tags: microsoft crm dynamics crm microsoft crm