Activity view default filter, missing due dates and how to modify the filter

How to change the default filter value

There’s been numerous blog posts written on the topic of setting the filter defaults on CRM 4.0, but I was initially a bit surprised I couldn’t find a working piece of Javascript to achieve this on CRM 2011. Examples like this, this or this didn’t seem to be working for me, but luckily I ran into this post on the Microsoft Dynamics CRM German forum by Andreas Buchinger. To save you the trouble of Google Translate (well, it’s not much trouble at all when using Chrome’s built-in translation toolbar), here’s a walk through of the steps needed.

1. Create a new Web Resource of type Script (Jscript) and click the Text Editor button, then paste in the code from the above post.

2. Open the form customization window of the entity where you want to change the Activity view filter default. In this case we’ll do it on the account form. Select “Form properties” on the ribbon, click “Add” on the Form Libraries section and find the web resource you created in step 1.

3. Click the “Add” button on the Event Handlers section of the window to add a new entry for form OnLoad event. Select the library you created in step 2, enter SetView as the function field value and ‘Activities’, ‘All’, “crmGrid_Account_ActivityPointers_datefilter” in the parameters field.

4. Save & publish everything. Done! Just open an account form, navigate to associated activities view and witness the “Filter on” value being set to “All”.

When working with Contacts or Opportunities, just modify the third parameter value accordingly. If you want to set a different default value than “All”, the choices for the second parameter are ‘Overdue’, ‘Today’, ‘Tomorrow’, ‘NextXDays;7′, ‘NextXDays;30′, ‘NextXDays;90′, ‘NextXMonths;6′, ‘NextXMonths;12′. Once again, thanks to Andreas for providing us this script and the parameter values!

Just remember that it’s not a supported customization, so in case any of the view names change in future updates, you may need to modify the script. For instance, when I was testing on a system with Finnish base language, the view parameter was “crmGrid_Account_ActivityPointers_scheduledend” initially, but on an Update Rollup 5 system this appeared have changed globally to “crmGrid_Account_ActivityPointers_datefilter”.

If you’d rather see the Activity default filter being set to “All” in the Microsoft Dynamics CRM standard configuration, please go and vote on the related Microsoft Connect suggestion (Windows Live ID login required). Thanks.

Page 2 of 3 | Previous page | Next page