FAgudelo
07/15/2020, 5:41 PMfunction validatedelete_removeline()
{
//alert("In valididate delete")
//Tell steve your issue on how it's firing on the administrator role aswell.
var userRole = nlapiGetContext().getRole();
var soStatus = nlapiGetFieldValue('status');
nlapiLogExecution('Debug','Debug Process',soStatus);
nlapiLogExecution('Debug','User Role',userRole);
/**
* Here we put the Roles we want to lock the system on:
* 1. AE Account Executive 1025
* 2. AE Account Manager 1026
* 3. AE Sales Manager 1038
* 4. BT Account Executive 1082
* 5. Director - Skytron 1061
* 6. EMEA Sales Manager 1129
*
*/
if(soStatus == 'Pending Fulfillment'){
if (_logValidation(userRole) == '1082' || _logValidation(userRole) == '1026' || _logValidation(userRole) == '1025' || _logValidation(userRole) == '1038' || _logValidation(userRole) == '1061' || _logValidation(userRole) == '1129' || _logValidation(userRole) == '1061' ){
console.log('Please Start ????');
nlapiLogExecution('Debug', 'Debug Process', 'Debug');
alert("You are not able to remove this Line.");
return false;
}
}
function _logValidation(value)
{
if(value!='null' && value != null && value != '' && value != undefined && value != 'undefined' && value != 'NaN' && value != NaN)
{
return true;
}
else
{
return false;
}
}
seanlin
07/16/2020, 1:34 PMseanlin
07/16/2020, 1:45 PM