My multiselect field contains 6 fields that start with 'PC ' and 3 that start with 'OPS ' and I want to find all of these among a list of about 50. since there does not seem to be a way to do an 'or' search, I do two searches, however the results only return the first search:
var fld = form.getField('mymultiselectfield'); var ops = fld.getSelectOptions('PC ','startswith'); var ops2 = fld.getSelectOptions('OPS ','startswith'); throw 'ops: '+ops.length+'; ops2: '+ops2.length; Result: ops: 6; ops2: 0 Flip the search around: var fld = form.getField('mymultiselectfield'); var ops2 = fld.getSelectOptions('OPS ','startswith'); var ops = fld.getSelectOptions('PC ','startswith'); throw 'ops: '+ops.length+'; ops2: '+ops2.length; Result: ops: 0; ops2: 3 So out of curiousity I did a search twice on the exact same filter: var fld = form.getField('mymultiselectfield'); var ops = fld.getSelectOptions('PC ','startswith'); var ops2 = fld.getSelectOptions('PC ','startswith'); throw 'ops: '+ops.length+'; ops2: '+ops2.length; Result: ops: 6; ops2: 6 Looks like the filtering is reducing the array of available options so that subsequent searches can not find anything other than what was searched for in the first result. Worse, the field the getSelectOptions search was done against REMOVES THE OPTIONS so when the list displays on the form it only contains whatever the result of the getSelectOptions returned (if it returns 0 then you end up with an empty real list). This is clearly a bug and there is no workaround that I could discover (tried recalling the getField, using different variables for each search, etc).