Saturday, October 31, 2015

 var error;

        if (e instanceof nlobjError) {
            nlapiLogExecution('ERROR', 'system error', e.getCode() + '\n' + e.getDetails());
            error = e.getCode() + ': ' + e.getDetails();
        } else {
            nlapiLogExecution('ERROR', 'unexpected error', e.toString());
            error = e.toString();
        }