I am creating a Custom User Interface via a Suitelet. Part of the interface will be a Sublist that will hold select items and data about the select items. One of the data points I need to hold is the Unit of Measure. The selectable items in the drop-down should mirror those in native item record or transaction record functionality.
The image is from a Work Order, but illustrates the concept. The available items in the selector will depend on the item selected earlier in the line.
I am able to pull the relevant Units Type record and from the UOM sublist on the Units Type record, pull the information I will require for each value (the internal id, the abbreviation, the conversion factor, and whether it is the base unit).
Where I am struggling is putting those options as select options in the sublist in a way that the available selections depend on the item set in the item sublist column. I was able to use the source property in the sublist.addField method to source the Units Type records:
But that isn't what I want. I was not able to figure out how to get the actual units of measure to display. Using addSelectOption doesn't seem to apply here, since that would add the select option for all lines, but the select options need to be line dependent. And there is where I am stuck. I have searched the Help Center and SuiteAnswers, but all I could find was dependent drop-downs using custom fields, not in the context of a custom user interface built in a Suitelet. I have also searched the community here with no additional help.
Thanks in advance for any ideas or guidance as to how to solve this stumbling block.
Cheers,
Pierre