I am trying to get the count of how many selection...
# suitescript
p
I am trying to get the count of how many selections were made in a multiple select field. I have tried the following but all gave a value of 1 even though I made more than 1 selection:
Copy code
var totalSelections = selectedValues ? selectedValues.split(' ').length : 0;
Copy code
var totalSelections = selectedValues ? selectedValues.split('<br>').length : 0;
Copy code
var totalSelections = selectedValues ? selectedValues.split(',').length : 0;
How can I get the total count of how many selected?
b
im guessing you are getting the value of the multiple select from a suitelet, in most other cases its an array thats easy to get the lengtn
in which cast the enquiry character
'\u0005'
is used as the seperator
p
got it. and yes, via suitelet. thanks. will give that a try.
n
Annoyingly in ss1.0 you could use nlapiGetField*Values*(fldnam)
b
not actually a option for a suitelet's request
n
no, but in SSS2.0 not even a record option!