Filtering Option Sets

Slalom Consultant Xavier Vargas

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:

Slalom Consulting - Xavier Vargas: Filterine Options Sets

Happy CRMing!

Slalom Consulting’s Dallas office Slalom Consulting's Project & Program Management focus
Learn more about our Dallas office Learn more about Slalom Consulting Customer Focus

subscribe by emailSubscribe to be emailed about new CRM posts

About Xavier Vargas
Slalom Consultant Xavier Vargas has worked with Enterprise CRM customers in numerous verticals. Based in Dallas, He has also delivered training engagements as an MCT (Microsoft Certified Trainer).

3 Responses to Filtering Option Sets

  1. Phong Nguyen says:

    Hi Xavier,

    I am trying to do the exact same thing here! However, I am missing something. How does your code retrieve the User’s Business Unit?

    Thanks,
    Phong

    • Phong Nguyen says:

      Also, I’m not sure why I keep getting the error Error:’optionSetValues’ is undefined in the loop in the code. It is defined…

      • Phong Nguyen says:

        Nevermind about the optionSetValues part. I figured that out. However, it doesn’t seem to remove values properly… and of course, i will want to dynamically populate depending on BU

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: