A common request from users is the ability to extend the records to be searched. In this post I am going to show how a custom plugin can be used to modify the search’s filtering criteria on the fly. This is a simple example however it can easily be extended to cover other scenarios. The Account Quick Find view filter is configured to search active records where the owner is the current user.
Utilizing our plugin when the user enters a percentage sign as part of the search string then the filtering condition that restricts the owner to the current user is removed.
The QuickFindExtender plugin is registered on the RetrieveMultiple event of the account entity at the pre-validation stage. The plugin intercepts the query and searches the FetchXML to see if the user entered a percentage sign part of their search string. If it contains a percentage sign then the filtering condition that restricts the owner to the current user is removed.