CRM 2011 Custom Filtered Lookup

Sometimes the filtered lookup functionality provided by CRM 2011 doesn't fit your requirement. However Microsoft provides a function for us to add our own custom view for the lookup field.

Example: In a 'Case' form we have customer field. I use this field only for 'Contacts', and I have created a relationship to the 'Account' so that we can see both on the form. I want the Accounts to only show Contacts that have 'Connections To' and vice versa (Only show Contacts that have 'Connections From' if I specified the Account first). If nothing is specified then I want both to show just Active Contacts/Accounts.

The script:

Then you can use it like this:

However there is still a major limitation of FetchXML that you cannot use UNION clause (or something similar). So If you want to show the primarycontact/parentcustomer along with the connections, you're out of luck as you can only do one of them.

Hope this helps,

Post a Comment