Hi everyone, so, I am looking at NS help for the s...
# suitescript
m
Hi everyone, so, I am looking at NS help for the serverWidget.FieldType and all the different types of fields available (screen shot of the list), and I don't see one that would be the search/list field (other screenshot here). Is that fieldType not available from the serverWidget for a Suitelet? 🤔
r
That is the SELECT field type I believe.
m
ok, thanks, I have used the SELECT before with options to create a simple dropdown, but perhaps there is another way to use it. I'll go take a look at the docs for SELECT. thanks!
j
examples:
let customer_single_select_field = form.addField({ id: ‘entity’, type: serverWidget.FieldType.SELECT, label: ‘Customer’, source: ‘customer’ // What type of List/Record? }); let customer_multi_select_field = form.addField({ id: ‘entity’, type: serverWidget.FieldType.MULTISELECT, label: ‘Customer’, source: ‘customer’ // What type of List/Record? });
m
All I can find in the docs is how I have used SELECT in the past, like this:
var selectField = form.addField({
id : 'custpage_selectfield',
type : serverWidget.FieldType.SELECT,
label : 'Select'
});
selectField.addSelectOption({
value : '',
text : ''
});
selectField.addSelectOption({
value : 'a',
text : 'Albert'
});
that doesn't do what I am looking for. I could load list of options from a saved search and set these, but it's not really what we want . I was hoping for that search and list functionality
@jen ah, the source property! Thank you!! That's it!
f
You can also populate the select by referencing the search vs looping through the results.