Filtering Option Sets
January 25, 2012 Leave a comment

Xavier Vargas has worked as a CRM consultant with focus on the Microsoft Dynamics CRM platform for the last seven years. He currently works for Slalom Consulting helping build and maintain a first-in-class team in Dallas that enables his clients to win on all of their CRM initiatives and strategies.
Recently we ran into the need to filter option sets dynamically based on what Business Unit a user is in. Imagine the scenario where you have a dozen or so business units, each with a unique sales process. If you want to leverage the out of the box reporting and use the Sales Stage field, you’ll soon find that you have 50+ values in that drop down. At best this is a nuisance for end users, at worst an end user might end up inadvertently selecting an invalid value.
The following snippet of code allows us to filter an option set based on the passed in Business Unit name. An array of values is selected and any value in the option set that is not in the array will be removed. The result is a nice and tidy drop down with only those values we need:
Happy CRMing!
![]() |
![]() |
| Learn more about our Dallas office | Learn more about Slalom Consulting Customer Focus |
Subscribe to be emailed about new CRM posts











