So I know what activitytypemask is for - it's to specify whether an activity should be listed in the activity menus. And that it cannot be changed after it's set (which means it cannot be turned off for system activities, very annoyingly).
I'm trying another hack at the problem I've seen a lot of people trying to address, which is how to hide unused system activity types. By going through this and other forums/blogs, I figured out how to write a plugin that's registered on the retrievemultiple of savedquery, which can hide views based on whatever condition I specify. Great. So I put it to filter on "DO NOT USE", and started all the Fax views with "DO NOT USE". So on the activities home page, it does not show those views. BUT - because Fax has an ActivityTypeMask of 1, it still shows a View Subcategory of Fax - it just has nothing underneath it.
I figured okay, it's querying for which entities have this typemask flag set, and then going and getting all of the views from those. So I just need to figure out where that query is happening, and intercept it as well. So I turned on SQL Profiler, and loaded the Activity home page. Not a single query is happening with ActivityTypeMask in it anywhere. What's happening is that it's running the RetrieveMultiple query against the SavedQuery table individually for each TypeCode (when you click on that individual subcategory to expand it), rather than it being one query with the TypeCode as a parameter. But I cannot find where it's coming up with that list of TypeCodes to query and create subcategories for in the first place. Does anyone have any idea how this data is being read/used, if no db queries are hitting it? I'm stumped. I mean, I wonder if maybe it's related to the fact that you can't change it after it's set - maybe it's not *being* queried? Doesn't make a lot of sense to me, but I just cannot track anything down on it.
*This post is locked for comments