I have a UE script that calls a function from a cu...
# suitescript
m
I have a UE script that calls a function from a custom module inside the beforeLoad. Trying to set some addresses on a select field, but receive this error message: "TypeError: Cannot call method "addSelectOption" of null"
Copy code
address_book_field.addSelectOption({
        value: address_internal_id,
        text: address
});
My logs show me all the values in address_internal_id & address so not clear why it thinks there is a null value. The address_book_field is generated dynamically at the start
Copy code
const address_list = context.form.addField({
    id: 'custpage_cus_address',
    type: serverWidget.FieldType.SELECT,
    label: 'Customer Address'
});
c
It's saying that
address_book_field
is null
m
I uncommented the addSelectOption and the script ran fine and I can see the select field on the form. That suggest the issue lies with the addSelectOption method?
b
you need to share more code