HOW TO GET THE TYPE PARAMETER OR RECORD ACCESS MODE IN CLIENT SCRIPT SAVE EVENT?
Category : NetSuite suitescript SuiteScript 2.0
The Save Record event on a Client-side script does not have the ability to determine the value of the ‘type’ parameter or Access Mode (create, copy, edit) of a record unlike the Page Init event. The alternative is to make use of a global variable that stores the type from page init function and can then be accessed from save function.
var access_mode = ”; // global variable
function clientPageInitl(type){
access_mode = type; // to read it in before submit
}
var access_mode = ”; // global variable
function clientPageInitl(type){
access_mode = type; // to read it in before submit
}
function clientSaveRecord(){
alert(‘access mode = ‘+access_mode);
}