I'm trying to limit the list of departments for ce...
# suitescript
m
I'm trying to limit the list of departments for certain roles on the items sublist for transactions. I've written a script that will throw a pop-up informing the user that their role is not allowed to use that department when selected. I reference a custom field on the department record where I select roles I don't want to be able to use the department. My question is, is it possible to completely remove an option from a list of values using a client script? It would be cleaner than the method I am using.
n
If its the native netsuite field for department {department} then I don't think you can update the list to remove any values. What I have done in the past is have a UE script that hides the native field that I want to edit the list of. Then in the UE script create a new temporary field to hold the values you want. Then when you save the record, you just have a piece of code in beforeSubmit that copies the selected value in your custom field to the native field.
👍 1
m
Thank you very much
👍 1