User.roleId

Note:

The content in this help topic pertains to SuiteScript 2.0.

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.x Script Types.

Module

N/runtime Module

Since

2015.2

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/runtime Module Script Samples.

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

        

Related Topics

runtime.User
N/runtime Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices