How to easily create dependent Picklist(Option Set) in CRM 2011 ?
Remi Boigey, Partner Technical Consultant @ Microsoft France, did a new silverlight application in order to create Dependent Picklist by using a user friendly interface.
Solution Features
- It provides a generic, re-usable JScript library that can be used for any pair of option set fields.
- It allows for a chain of dependent option set fields. Because each dependent option set field options are filtered based on the value of another field, additional option set fields options can be filtered by the option chosen in the first dependent option set field. This allows for the possibility of a set of hierarchically dependent option set fields.
- The filtering of dependent options is set in an XML Web resource. This allows for changing the option mappings without changing the code. Editing an XML Web resource is easier for a non-developer to configure options with less opportunity to break the code.
- The solution supports multiple languages. The filtering is based solely on the data value of the options rather than any text in the options.
- Filtering works for any number of instances of an attribute control on the form.
Install the solution
Step 1 : Save the CRM solution on your disk - Download here
Step 2 : Import the solution – Settings / Solutions / Import
Click on Browse Button and select the solution DependentPickLists_1_0_0_0_managed.zip.
Click on next buttons and close the form.
Refresh the web page.
Test the solution
In order to test the solution, you can use the Case entity with the two OptionSet fields: Case Type and Priority. We will filter them as displayed in the following table:
Case Type
Priority
Question
High
Normal
Low
Problem
High
Normal
Request Normal
Low
When you finalized the mapping, click on ‘Get script’ button.
In order to use our script, you need to add a XML web ressource to the targeted entity.
Step 1
- Go to Settings / Customization / Customize the System / Web Ressources
- Click on New and fill the following attributes
- Name = Schema Name
- Display Name
- Type
- Select Data XML
- Click on ‘Text editor’ and paste your clipboard
- Save the form
Step 2
- Go to Settings / Customization / Customize the System / Entities / Case / Forms
- Open the Main Form
- Click on Form properties
- Add “gps_SDK.DepdenentOpeitonSet.js” script as available libraries
- Then, in the ‘Event Handlers’ section, add the SDK.DependentOptionSet.init function on the control Form for the event OnLoad.
- And follow the printscreens :
- Click on Add
- Function: SDK.DependentOptionSet.init
- Check ‘Pass execution context as first parameter’
‘new_Case_DependentOptionSetConfig’ The parameter is the schema name of the Web ressource we just created.
- Click on OK
- Save the Form.
- Now, we have to add a function ‘SDK.DependentOptionSet.filterDependentField’ on the onchange event of the primary field (here case type)
- Double click on the ‘Case Type"’ Field
- Select the Events Tab
- Click on Add under the Event Handlers section
- Function: SDK.DependentOptionSet.filterDependentField
- Don’t Check ‘Pass execution context as first parameter’
‘casetypecode’,’prioritycode’ Parameters are the schema name of the option set fields..
- Click on OK
- Save the Form
- Publish all customizations
- Navigate to Case Form and use the picklists : Case Type and Priority
Comments
Anonymous
April 30, 2011
Hi, I imported this solution. It imported with warning. And alos when i clicked on Dependent Picklist under customization, its giving an expecting as "Debugging resource strings are unavailable etc., And also can't see any entities under Entity on the "Dependent Picklist form". Any Idea?Anonymous
May 01, 2011
Could you please send me an email with screen shots? remib@microsoft.comAnonymous
May 18, 2011
Where is the "Get Script" button you mentioned in the article?Anonymous
May 18, 2011
Never mind...I am getting the same error as NAG when I click on Dependent Picklist...will send you the screenshot in separate email.Anonymous
August 11, 2011
This is not working as expected please help!Anonymous
August 11, 2011
Is now, perfect!Anonymous
August 26, 2011
I can't get this to work. I followed these steps exactly and then when I go to create a new case, the ribbon on the case screen disappears and the dependent pick list doesn't fire. I removed the event handler and the ribbon came back. I tried to create a dependent pick list with a custom entity and the same effect. Not sure how I can debug this. Too bad, as the front end tool is very nice and easy to use.Anonymous
September 28, 2011
We add a new post for Recurrent problems here : blogs.msdn.com/.../dependent-picklist-recurrent-problems.aspxAnonymous
November 20, 2011
HI, tried to insta;; and use this, get an exception when browsing to the Dependant Picklists Option in Settings. Have emailed you a screenshot, please advise, I would be very grateful.Anonymous
November 24, 2011
Wow, great useful solution. Thanks! PS: I have an CRM based on a german base language, javascript wasn't loaded correctly first. Can be usefull for all europe users, you may want to change the asci code of the javascript... but then all works perfect!Anonymous
December 13, 2011
Can you please email screenshots? cardohmeyer@yahoo.comAnonymous
December 13, 2011
Nevermind I got it! Thank you so much!Anonymous
January 05, 2012
How can you do two different dependent pick lists on the same form? What do I put in the Form Properties "On Load"? Thanks so much!Anonymous
February 16, 2012
Hi there, I used the Dependent Option Sets Silverlight application - and it works great - thank you! I have a question - I created a dependency between two option set fields on a form and they work perfectly. I then tried to do the same for another set of fields on the same form but it wont work - is there a solution to get this working? Thanks!Anonymous
February 20, 2012
Getting the below error. Please Help!! There was an error with this field's customized event. Field:window Event:onload Error:Access is denied.Anonymous
March 28, 2012
Hi, got the same error as Lily. This happened when transfered to another environment with SSL authorizaton.Anonymous
April 06, 2012
Nice Article..! Can any one provide me the sample XML that as we need to add as a web resource. Thank you in Advance SreeniAnonymous
April 06, 2012
Do we need to create two options sets ot it will automatically creates when we upload XML data. Please suggest me Thanks, SreeniAnonymous
May 21, 2012
Another option for CRM 2011, which is codeless, is to use filtered lookups. Here is my blog explaining the process. leontribe.blogspot.com.au/.../setting-multi-level-categories-against.htmlAnonymous
May 22, 2012
HiAnonymous
May 22, 2012
Thanks for your post. Its quite helpful! However, i've a requirement where i've 4 optionsets on the form. Now, with the steps mentioned above I can set dependent optionset between first 2 optionsets. Now, I need to populate 3rd optionset based on selection from 2nd optionset and 4th optionset based on selection from 3rd optionset. Can this be achieved? Early reponse is much appreciated. Thanks!Anonymous
August 27, 2012
After finalizing all the required steps working on two specific fields (FIeld A) & Field B) i'm not seeing any results. When i select from the drop a specific data from field A, i'm still seeing all the data in field (B) when i'm suppose to see only the mapped data. Any suggestion? ElieAnonymous
September 08, 2012
Thanks for the great article ,Now when I open the CRM using IP address instead of Server Name I got JavaScript error access deniedAnonymous
September 10, 2012
I was able to Import the solution and use the form to set up a couple of dependent option sets, but now I need to modify the dependencies and when I click on "Dependent PicklIsts" in the Nav pane I no longer get the form but the code that was generated instead. Is this correct? How do I go about redoing some of the dependencies? Thanks.Anonymous
November 15, 2012
Thanks for the great article .. explained in very simple steps ....it worked perfectly :)Anonymous
November 21, 2012
H all andI hello neel could explain some steps you followed coz i am not having any error and neither the dependendent values are working Thanks in advanceAnonymous
November 22, 2012
@carlyd What is your solution with the problem, that more then 1 dependant picklists is not working? I havt 3 picklists, 1 is depanandt to 2 and 2 dependant to 3, but i will not work. THX for any help, Greets PitAnonymous
December 09, 2012
Hello, thank you the great tool , Any idea of how can we add more than two dependent pick list on the same form ? any workaround ? having the same code on change event will break the code and both dependent pick lists will not work . Appreciate your helpAnonymous
December 13, 2012
i performed the same steps.but this solution not working.no filtering performed. please help me.Anonymous
May 30, 2013
Hi, I find the same problem of Lily but in Chrome only. There was an error with this field's customized event. Field:window Event:onload To solve this, I modified an javascript, you can find my version on this link. ggoulf.blogspot.fr/.../how-to-solve-problem-of-dependent.htmlAnonymous
July 01, 2013
Hello, after installation of the solution (CRM 2011 online) Within the solution, I choose a entity, then I'm able to choose a primary picklist and a related picklist but no items are visible in order to make the mapping !! Can you help please? Thanks, Raynald from FranceAnonymous
September 04, 2013
Hi, What rollup/s is this solution supported against does anyone know? ThanksAnonymous
October 15, 2013
Hey, I tried installing this solution in CRM 2013 RC1 and RTM, but in both I can´t see the options. So I can choose an Enitity and primary/related Picklists, but then the options are missing. Can you confirm this in CRM 2013? Maybe it is just a fault for my part. Regards PatrickAnonymous
October 16, 2013
Hey, I was able to solve this on my own. You need to set up your Internet Explorer to Browser Mode IE8 and Document Mode to "IE8 Standards". Just hit F12 on your CRM-Site to get access to these options. This is only relevant for the Setup, End Users don´t Need to Change anything. Works like a charm. PatrickAnonymous
March 06, 2014
This was working perfectly, but then the option vanished from my Sitemap. I tried uninstalling, but having some difficulties with that. Any idea on how to restore to my sitemap to access it again?Anonymous
June 09, 2014
The comment has been removedAnonymous
December 03, 2014
Thanks for this solution. I have a bit more demanding form. I have 4 sets of drop down. Service: Resource: Complaint Type1: Complaint Type1Step2: Complaint Type2: Complaint Type2Step2: Complaint Type3: Complaint Type3Step2: Is there any solution for this problem? My Service : Resource: dropdowns are working fine with this code. But I have more dropdowns in the form MathewAnonymous
August 24, 2015
Is this solution available as unmanaged? Because in CRM 2015 you can't install it and when you update from crm 2011 to crm 2015 with the installed managed solution there is an error because in the script "getserverurl()" is not supported any more. Script has to be updated to "getClientUrl()".Anonymous
September 15, 2015
The dependent picklists in not coming out below Dynamics Marketplace