On NetSuite Items forms, I would like to remove some items of the dropdown list “Sub-Item Of” (field name "parent"), which currently displays all NetSuite Items.
I've tried to create a User Event Script, on Before Load and use the API nlapiRemoveSelectOption, however NetSuite raises an error informing that the method does not exist. When trying to use the API on Client side, it returns an error informing the method is not available on client. The method was called as following:
nlapiRemoveSelectOption('parent', '1'); // 1 is the internal Id
After investigating the scripts source code, the only way I was able to remove the items from the list was using a non-documented method named deleteOneOption on Client Side.
getDropdown(window.document.getElementsByName('inpt_parent')[0]).deleteOneOption('1');
However, this should not be the best approach, as it is not documented and I am accessing the DOM objects directly, which may not work on the future versions.
Does anyone know a better way to remove some items from that field?
Thank you.