Modules

filter

 

Objects/Functions

module (N/runtime)

SuiteScript 2.0

User.roleId

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=User.roleId for more information.

N/runtime Module
User.roleId
Property Description: The custom scriptId of the role for the current user. You can use this value instead of User.role. When bundling a custom role, the internal ID number of the role in the target account can change after the bundle is installed. Therefore, in the target account you can use this property to access the unique/custom scriptId assigned to the role.
Type: string (read-only)
Supported Script Types: Client and server scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/runtime Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=User.roleId

Example:

// Code Example 1
// Add additional code
//...
var userObj = runtime.getCurrentUser();
log.debug('Custom script ID of current user role: ' + userObj.roleId);
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4296670260.html