Wednesday, 24 May 2017

Steps to Hide the Print Button for a User having a Custom Customer Center Role when a Sales Order is Viewed on the Web Store Context

​For a custom Customer Center role having Fulfill Sales Order=None, when a user clicks See Orders in theCustomer Center > view any order > a Print button is displayed. To hide this Print button, here are the steps:

1. Create a user event script by navigating to Customization > Scripting > Scripts > New > User EventUser Event needs to be setup this way: 

Deployments 
Applies to: Sales Order 
Deployed: Yes 
Status: Released 

Scripts
Before Record Load: restrictPrintButtonOnWebStore <-- this is the name of the function 

Script :

function restrictPrintButtonOnWebStore(type, form){ 
        var currentContext = nlapiGetContext(); 
        if (currentContext.getExecutionContext() == 'webstore') { 
                nlapiLogExecution('Debug', 'context', currentContext.getExecutionContext()); 
                userRole = nlapiGetRole(); 
                nlapiLogExecution('Debug', 'nlapiGetRole()', userRole); 
                if(userRole == 1017){ 
                      var button = form.getButton('print'); 
                      button.setVisible(false); 
                } 
                 
        } 
}

3 comments:

  1. It is really a great work and the way in which you are sharing the knowledge is excellent. Thanks for your informative blog.
    NetSuite Santa Monica

    ReplyDelete
  2. Great tutorial! Customizing user permissions in NetSuite is crucial for controlling data access and security. Implementing such UI restrictions can prevent unauthorized actions and streamline workflows. If you're looking for expert guidance on NetSuite customization, our NetSuite consulting services can help optimize your system. Thanks for sharing these valuable insights!

    ReplyDelete