Uncheck all in Multipicklist

  • 1
  • Problem
  • Updated 1 year ago
  • Solved
  • (Edited)
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.
Photo of Rowel Ventura

Rowel Ventura

  • 424 Points 250 badge 2x thumb

Posted 1 year ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
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. 
Photo of Rowel Ventura

Rowel Ventura

  • 424 Points 250 badge 2x thumb
Is it possible to do the "Uncheck all" functionality using a snippet?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Yes.

model.updateRow(row,'fieldapiname','')
Photo of Rowel Ventura

Rowel Ventura

  • 424 Points 250 badge 2x thumb
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"
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Where are you setting the max selectable items?
Photo of Rowel Ventura

Rowel Ventura

  • 424 Points 250 badge 2x thumb
In the Field Properties above
(Edited)