Hi Kei,
Database changes are not supported, so to remain true to that, you'd need to update through the SDK.
I apologize, I got so focused on fixing the data that I missed out on a solution you suggested in your original post. This could be a little painful to write but it'll do exactly what you're looking for.
There is a way to update the advanced find criteria when you search so empty fields are treated as null. I was part of a team that did something very similar for CRM Intelligent Query (free at: www.CrmIntelligentQuery.com ). For that add-on we intercept the search request on the way to CRM and modify it a little. In this way, we let people you the build in views and query and do left joins, or "doesn't-have" queries.
You would do the same thing, where when there's a condition for "X Does not contain data", you modify the query so it's grouped ("X Does not contain data" OR "X Equals (empty)". This way you'll get back both conditions, but to the user they only pick the normal one.
This is how you'd implement the new plugin:
- Create a new plugin registered on the RetrieveMultiple event, with "none" as the entity. It will run for views, advance finds or even SDK requests for every entity in CRM.
- In the plugin code, make sure the MessageName is RetrieveMultiple, and that the InputParameters contains Query (that will be the query coming that was run)
- The Query property will be either a FetchExpression or QueryExpression depending on where the query was initiated from.
- When you have your query, traverse the nodes to look for the conditions for Contains data and does not contain data, these are the ones you want to update. Modify that particular condition so its grouped as an OR the way we talked about above and you're be good to go.
I really hope this helps, it's a cool thing to implement and would really make searching a lot easier for your users.
Thanks,
Aiden