Ho to add below button on sublist form.addButton(...
# ask-stanley-ai
v
Ho to add below button on sublist form.addButton({ id: "custpage_mark_committed", label: "Mark Committed", functionName: "markCommitted", });
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you can add a button to a sublist in NetSuite using SuiteScript. Here is an example of how you can do it:
Copy code
javascript
var itemSL = form.getSublist({id:'item'});

itemSL.addButton({
    id: 'custpage_create_item',
    label: 'Search For Item',
    functionName: 'createItem',
});
In this example,
form
is
scriptContext.form
in a User Event Script's beforeLoad function. The
getSublist
method is used to get the sublist with the id 'item', and then the
addButton
method is used to add a button to this sublist. However, please note that the button will only appear in Edit mode, not in View mode. This is likely by design in NetSuite. If you want the button to always be visible, you might want to add it to the form itself, not to a sublist. Also, it's important to note that you can't add a button to sublist columns. If you want to add a button against each row, that appears not to be possible. A possible workaround could be to add a checkbox and once they select that checkbox they can hit the download button. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861050427
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85995537
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853999496
Please provide your feedback on this answer.