When I do field.removeSelectOption in the console ...
# suitescript
a
When I do field.removeSelectOption in the console it works, but when I try doing it from a field changed or post sourcing it doesn't
s
Is the field in a subtab?
a
Nope
Mainline
s
It's a line column?
a
No. A custom field for list/record with sourced info
s
Is the custom field a field created in UE / Suitelet with a custpage prefix?
a
no
s
It's beyond what I know, but if it isn't a field created with custpage, removeSelectOption is unlikely to work Usually you'd go with a (fake) field or even a field via css and apply it to the real field if that's your final intention
a
But why would it work in the browser console?
And not in the client script
s
you could do the same with a jQuery DOM hack, I think what you're doing in the console after the page has loaded (after pageInit etc) thats what youre doing
this is why I asked if your body field is in a subtab, the dom hack will fail the subtab essentially because it also isn't triggered on page init, instead its triggered when you click on the subtab
a
I don't mean page init. I am opening the chrome browser, loading the Netsuite modules, getting the currentRecord, getting the field, and trying to remove some of the options
s
If I understand you correctly, you're running code in the console, and you dont understand why the same code doesn't work pageInit?
a
Not Page Init. post sourcing and field changed
s
When it works, its from console?
Or it doesn't work at all?
a
Yes. In the console it works, in the script, it doesn;t
s
Just to confirm it's not a sublist field (transaction columns etc)? custcol_x
a
Correct
s
And when you load the page you can see the field immediately? And you're trying to manipulate it?
I'm pretty sure if what I've understood what you've gone through currently the best option is a fake field in the UI that will attach the the real field
Otherwise you'll put all the control to the real field itself with sourcing and filtering (if its a custom field)
a
Okay. Thank you