Hello, Everybody. I created the sublist that has ...
# suitescript
x
Hello, Everybody. I created the sublist that has 2 columns - Item, PurchaseOrder. Item is List/Record field on Item record. Now, I want to create drop-down PurchaseOrder column that is filtered by selected Item. Could you please let me know how can I create this column in custom form in Suitelet? Thanks
b
suitelets arent known for being dynamic
unless you are planning on reloading the page and filling in the select options serverside, you will be using Field.insertSelectOption(options)
x
Hmm... but, when we create a custom field or list, we can use Sourcing & Filtering feature. It means that we can implement this logic in UI,
b
if you can find a sourcing and filtering option in the docs, feel free to use it
dont expect to match the features available in the ui using the serverWidget, its not that powerful
x
So.... there isn't any other option to do this logic?
b
nope, essentially do it yourself
w
@battk would you use Field.insertSelectOptions on lineInit or could you do it serverside for each line already?
b
wont be that nice
have to do it on fieldChanged for when the source field change
and lineInit since the same field is shared among all lines, meaning same options
may also end up dealing with the ugliness that CurrentRecord.getSublistField(options) requires an existing line
👍 1