Tuesday, September 25, 2018
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 the Customer 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 Event. User 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 File:
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);
}
}
}
Note:
1. This script will execute only for the Web Store Context and will hide the Print button if the user role is equal to 1017. Role 1017, is the internal id of the custom Customer Center role.
2. User can modify this script easily to cater to their specific process.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment