Add Selection to List/Select Field w/ SuiteScript
Hi, is it possible to add a selection to a list field with SuiteScript, similar to how you can do it in the UI by clicking the ‘+’ button?
I thought maybe I could use record.create, but I don’t think custom lists are a supported record type.
Maybe convert it to a custom record instead of a custom list?
The problem is I don’t want the order of the options to be in alphabetical order, and if I do a custom record, I haven’t figured out a way to control the ordering without doing some sort of prefix gimmick added to each option.
Actually figured out you can update a custom list with SuiteScript. Just use record.load. The record type is ‘customlist’ and the ID is the the ID of the custom list. The list values are considered a sublist, so you can just select a new line and add a value. I didn’t try, but I’m sure you could probably create a custom list too on the fly with record.create.
sublistId is “customvalue”