web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Optionset Filtering

(0) ShareShare
ReportReport
Posted on by

i have two option sets , 1. gender->Male,Female 2. category->Mr.,Ms.,Prince,Princess. i want to filter category based on gender option value like ex1: gender : male --> category:Mr.,Prince ex2: gender: Female --> category : Ms.,Princess. After solution was moved to production, we added two more values to category like category:Mr.,Ms.,Prince,Princess,king,Queen so, without touching code how you achieve this..??? Please help me on this???

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Optionset Filtering

    Hi ,

    I don't think without code it is possible , you should move your solution or webresource.

    There is two way you can do this using Javasscript , here is the sample -

            function OptionSetAddRemove() {
                var optionSet = Xrm.Page.ui.controls.get("new_myoptionset");
                var optionSetValues = optionSet.getAttribute().getOptions();
                optionSet.clearOptions();
                optionSetValues.forEach(function (element) {
                    if (element.value == "831260009")
                        optionSet.addOption(element);
                    if (element.value == "831260008")
                        optionSet.removeOption(element);
    
                });
            }


    In addition you can also do using xml webresource. please refer below.

    https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2015/developers-guide/gg594433(v=crm.7)

    Above both the cases you need to move the web reosurce and in addition you need to move the solution to move the pick list value. So without code changes its not possible.

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Optionset Filtering

    Hi,

    You can try this solution and see if that's can help you: crmoptionsets.azurewebsites.net

  • Community Member Profile Picture
    on at
    RE: Optionset Filtering

    But i hear that it is possible with some configurations

  • Community Member Profile Picture
    on at
    RE: Optionset Filtering

    thanks for replay

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Optionset Filtering

    No , there is no way to do using configuration only . If you want to do this using configuration then it will better to implement dependent lookup in dynamics CRM.

    Please refer below -

    www.powerobjects.com/.../how-to-use-dependent-lookups-for-dynamics-crm-201320152016

    www.youtube.com/watch

    Please dont forget to close this thread .

  • Suggested answer
    Ben Thompson Profile Picture
    6,350 on at
    RE: Optionset Filtering

    It's not possible without some custom Javascript code. As Mahender points out however, this is a common requirement and someone has already solved this problem for you and he's provided a link to Guido's  go-to solution for this.

    Install it and follow the instructions and it just works....

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans