There are a few things we can do with the old good option sets.. Can we do all of that with Multi Select option sets, though? Let’s see..
Although, let’s actually define a multi select option set first – here it goes:
From there, here is what I wanted to try:
- Create a business rule condition
- Set field values through the business rule
- Create a workflow condition
- Set field values through a workflow
- Create a C# condition
- Set field values through C#
Quite a bit of work it might be, so let’s move on.
1. Creating a business rule condition
There seem to be no way to use a multi-select option set field in the business rule condition.
2. Setting multi-select field value through a business rule rule
Can’t do it either:
Basically, looks like multi-select option sets are not supported in the business rules.
Let’s have a look at the workflows, then.
3. Creating a workflow condition
My multi-select field is not available there:
4. Setting multi-select field value through a workflow
Can’t do it either – my new field does not show up on the form when configuring the update step:
Just to be sure, btw, I checked, quickly, that the field is on the form when I am updating the account record:
Well.. let’s try our last resort, the SDK.
Which means you can set a value as an array:
You can check how many items have been selected:
You can set “null” to empty the selection:
And you can check if a value has been selected:
Xrm.Page.getAttribute(“new_testmultiselect”).getValue() != null && Xrm.Page.getAttribute(“new_testmultiselect”).getValue().includes(100000000)
6. Creating a C# condition and setting a value
This seems to be a bit of a problem right now since we only have SDK for V8, but that version does not recognize Multi Select Option Sets. When trying to access such attributes from C#, we will be getting “null” all the time. It seems we might be able to make it look like V9 SDK by overriding SdkClientVersion property of the OrganizationServiceProxy (and we can use something like “184.108.40.2062”), but, then, we also need to implement a data contract resolver in C# to deserialize those Multi Select Option Sets. Quite frankly, I’m a little stuck with that right now, so it may or may not work out.. Worst case scenario, it seems I’ll have to wait till SDK for V9 has been published by Microsoft (and, as of this moment, it’s not, yet, available) in order to try multi select option sets with C#.