Uncheck all in Multipicklist

Hi. I set the maximum value of my multipicklist field to 1. And what happens is I need to click the “Uncheck all” first in order to select one option. Any idea on how can I fix this? I’m trying to do it in javascript such that it will do “uncheck all” functionality but it’s not working tho.

Max value of 1? As in the user may only select one? If so, that’s not exactly possible with a multiselect. You can override the metadata of the field and set as Picklist and manually add the values.

Unfortunately, there isn’t an easy declarative way of doing this that will stay updated with the options set in Salesforce. 

For the max value, I meant “Max selectable items” to 1. But what happens is you have to “Uncheck All” first in order to select an option.

Is it possible to do the “Uncheck all” functionality using a snippet?

Yes. model.updateRow(row,‘fieldapiname’,’’)

I’ve tried that one. But I think this is a bug that when you set the Max selectable items to 1, you need to click “Uncheck All” first in order to select an option. But when it’s more than one or the value is not set, then you can select option/s without even clicking the “Uncheck All”

Where are you setting the max selectable items?

In the Field Properties above