'Remove NetSuite Sublist Button
I have a NetSuite Suitelet script that is listing all of a customer's credit cards so that they can edit the cards themselves.
I would like to remove the "remove" button from that sublist, if possible. I've looked all over the NetSuite support site, with no luck. Has anyone encountered this before?
Below is the code that I have:
var creditCardSublist=form.addSubList('custpage_credit_card_sublist','inlineeditor','Current Credit Cards');
/* this does not work */
form.removeButton('custpage_credit_card_sublist_remove');
/* this does not work either*/
creditCardSublist.removeButton('custpage_credit_card_sublist_remove');
Thanks for any assistance with this.
Solution 1:[1]
Actually client side is what you have to do.
You create a client script to go along with your suitelet. use form.setScript... to associate it.
in the client script create an initLine function. That function can use jQuery (automatically included by Netsuite) to find and remove the Remove button.
This is a hack but Netsuite doesn't have any API for manipulating those lists
Solution 2:[2]
addSubList(name, type, label, tab) takes a type parameter, which decides the sub list type.
- editor - An edit sublist with non-inline form fields
- inlineeditor - An edit sublist with inline fields
- list - A list sublist with editable fields
- staticlist - A read-only segmentable list sublist.
So you might want to use a staticlist
type.
Solution 3:[3]
use this jQuery in relevant client script.
jQuery(".uir-insert").remove();
jQuery(".uir-remove").remove();
jQuery('#custpage_so_sublist_insert').hide();
jQuery('#custpage_so_sublist_remove').hide();
Note: you can only use jquery in clienscript so you must create client script along with suitelet script.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | bknights |
Solution 2 | Uma Kanth |
Solution 3 | G.Ranjith Kumar |