Trying to remove the Select Options of a custom se...
# suitescript
j
Trying to remove the Select Options of a custom select field i've added in a UE Script. Once I figure out how to remove the selectOptions, I'm going to Field added in a UE Before Load Function
Copy code
var newContField = scriptContext.form.addField({
                    id: 'custpage_contactfield',
                    type: serverWidget.FieldType.SELECT,
                    source: 'contact',
                    label: 'Contact V2',
                    layoutType: 'normal'
                })
CS pageInit
Copy code
function pageInit(scriptContext) {
            var myRecord = scriptContext.currentRecord;
            var newField = myRecord.getField({fieldId: 'custpage_contactfield'}); // field added through a UE BL script

            newField.removeSelectOption({value: null, })
n
I don't believe you can remove select options from a field that sourced. You can only remove options if you use field.addSelectOption to add them.
j
Thanks I'll take a look.
n
sorry, I meant to write you cannot remove select options from a field that's sourced
j
You're right
Just removed the source option, and the script is working now.
Thanks!
👍 1
Now I can't actually select any of the options I inserted.