I want to filter subsidiaries on the form ``` f...
# suitescript
m
I want to filter subsidiaries on the form
Copy code
form.addField({
      id: 'custpage_subsidiary',
      label: 'Subsidiary',
      type: serverWidget.FieldType.SELECT,
      source: 'subsidiary'
    })
can I display a list of Custom Entity Fields?
Copy code
Important After you create a select or multi-select field that is sourced from a record or list, you cannot add additional values with Field.addSelectOption(options). The select values are determined by the source record or list.
my output for filtering the list on the form is probably like this
Copy code
var selectField = form.addField({
      id: 'custpage_subsidiary',
      label: 'Subsidiary',
      type: serverWidget.FieldType.SELECT,
    })

selectField.addSelectOption({
    value : '',
    text : ''
});

selectField.addSelectOption({
    value : 'a',
    text : 'Albert'
});
n
I'm not sure how the above reflects any kind of filtering, looks like you're just adding a blank entry and Albert. You can search the subsidiaries based on the criteria you wish to filter on and then loop through the results using addSelectOption for each result. If you do this, do not specify the "source" in your field declaration.
m
yes thanks is that the only option? because through Custom Entity Fields Did not work out
n
Oh I see, you want a list of customentity fields to be in your dropdown list?
r
You could also specify a source in addField and then use removeSelectOption. I think.