Hi I am filtering values of a field based on the t...
# suitescript
a
Hi I am filtering values of a field based on the two other fields by using below shown settings. Is there a way to implement this using the script ??
s
Filtering field select options is not something you can do with suitescript if you set the
source
within the field definition. You need to manually run a search and add all the select options from the search results.
a
@Sandii add all the select options ?? How can we do this ?? using script ??
s
Well normally when you create a select field in script, you set the
source
with the record/list you want. If you want that record/list filtered, you need to not set a source, and manually add all the options using
addSelectOption()
from serverWidget module or
insertSelectOption()
from currentRecord module
a
ok got it. Can we do this with client script "Field Changed" function ??or which function do you think is best fit for this ?? @Sandii.
Because when a field is selected then I need the other field list to be filtered based on the current selection.
s
In the client, you have to use
N/curentRecord
options since serverWidget is serverside. You can use a combination of
getSelectOptions()
,
insertSelectOption()
, and
removeSelectOption()
depending on how you want to handle it.
a
ok thanks @Sandii