Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How is activitytypemask used/queried?

(0) ShareShare
ReportReport
Posted on by 3,079

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans