Hello, how to show only some Subsidiary in params ...
# suitescript
m
Hello, how to show only some Subsidiary in params map/reduce I can select only one filter =(
or externalId but still only once
n
I don't think I've ever done that, typically just used a text field type and comma separated values.
m
Comma-separated doesn't help me, since the whole string is taken for comparison in equal
n
I wasn't saying that, I was saying you make your parameter a plain freeform-text "type" and add the list of values you need to check against. In your code evaluate the value you have against the comma separated list.
So if for instance if this deployment wants to only only run for subsidiary 1,3,5,6 use that as the value in a text parameter field.
Annoyingly you cannot use a multi-select field for values in a script/deployment parameter.
m
is it true for everyone?
n
I don't understand the question? In the context of parameters on a script... yes. Why would it be different for different people? 🧐
m
no for parameter in map/reduce i don't see
I can't create a simple list with my custom ids =(
r
Do what @NElliott is suggesting. Create a param where Type is Free-Form Text. Use a list of acceptable (or not acceptable) subsidiaries of the form
1,3,5
.
e
I do this with a custom record, and set the script param to the custom record entry. The custom record contains the multiselect. (Among other values.) I find it easier to manage
2
r
That's a good idea. Doing it the other way would just mean you have to handle bad Sub selections from the user by sending an email (if MR) or message/dialog (if in a UI context). The custom record sounds preferable.
I would never trust a User to run an MR script so I don't typically filter parameters.
n
That's a perfectly valid way to work too. I guess it depends if it's a set and forget type param and how many deployments you have. You may not want the overhead of a custom record and making sure some idiot user doesn't delete instances of it 😄