Let’s take the following example:
– OptionSet A with the following values A1, A2.
– OptionSet B with the following values B1, B2, B3, B4, B5, B6.
– If A1 is selected, only B1, B2, B4 can be selected.
– If A2 is selected, only B3, B5, B6 can be selected.
Comma separated list of parameters:
- “mea_optionacode”: optionA schemaName.
- “mea_optionbcode”: optionB schemaName.
- [[1,1,2,4],[2,3,5,6]]: Array containing the dependencies:
- [1, 1, 2, 4]: value 1 selected, only values 1, 2, 4 can be selected.
- [2, 3, 5, 6]: value 2 selected, only values 3, 5, 6 can be selected.
6 thoughts on “Dependent OptionSet in Dynamics CRM V9”
Hi Mehdi, where do you enter the code for option A & B in the above script? Can you showcase the full details in the script based on your sample option set “mea_optionacode”,”mea_optionbcode”,[[1,1,2,4],[2,3,5,6]]?
The code I provided is generic, it works for any two optionsets.
The first two parameters are the schemaName of the two optionSets. The third parameter is an array that represents the dependencies between the values of the two optionSets.
I don’t have knowledge in JS, I have a Product Type & Product Subtype where product subtype is dependent of product type. What should I input under the MEA field?
And is it only the text with optionAName & optionBName that I need to replace with my Product Type & Product Subtype?
Yes, you need to replace optionAName & optionBName with the SchemaName of your two fields. Also, you need to configure the dependencies with the third parameter.
Don’t hesitate to contact me via my following email address if you need help: email@example.com
TypeError: executionContext.getFormContext is not a function
I am receiving this error. Function on line number 9 (executionContext.getFormContext();) is not defined. Can you help, how to resolve this error?