Hi everyone, I'm trying to add a button to a form ...
# general
e
Hi everyone, I'm trying to add a button to a form on a sublist, this is what I have: const itemSublist = form.getSublist({ id: 'item' });         itemSublist.addButton({             id: 'custpage_update_item_prices_sublist',             label: 'bottom Update Prices',             functionName: 'openUpdateSuitelet'         }); unfortunately, this is not working. any ideas?? Thank You!
t
@eliyahu moskowitz I think the issue is that you're accessing the sublist as a constant. Maybe try this:
var itemSublist = form.getSublist( { id : 'item' } );
e
thanks, but it didnt help
s
Are you sure you actually have the sublist? You do not show how
form
is defined.
e
its from context
var { form } = context
s
What version is your script file? I am not sure how long that destructing notation has been around. Maybe try just using
context.form.getSublist
e
it works by the edit mode but not view, just realized
is there any way to get this going on a sublist in view mode too