To get the “Mark All” and “Unmark All” buttons trigger in the custom suitelet page.

SAMPLE CODE:

We can write a client script 2.0 function in NetSuite to get the button click of the “Mark All” and “Unmark All” buttons in a custom Suitelet page using the following steps:

  1. In the client script file, create a function that will be triggered when the “Mark All” or “Unmark All” button is clicked. We can use the jQuery library to select the button elements by their class or ID.
javascriptCopy codefunction buttonClickHandler() {
  // Get the button elements by class or ID
  var markAllButton = jQuery('.mark-all-button');
  var unmarkAllButton = jQuery('#unmark-all-button');
  
  // Attach a click event listener to the buttons
  markAllButton.on('click', function() {
    // Code to handle "Mark All" button click
  });
  
  unmarkAllButton.on('click', function() {
    // Code to handle "Unmark All" button click
  });
}
  1. In the same client script file, call the buttonClickHandler function when the custom Suitelet page is loaded. You can use the pageInit function to achieve this.
javascriptCopy codefunction pageInit(context) {
  buttonClickHandler();
}

This code will attach click event listeners to the “Mark All” and “Unmark All” buttons on your custom Suitelet page. You can then add your code inside the event listeners to handle the button clicks as required.

Leave a comment

Your email address will not be published. Required fields are marked *