auth.changeEmail(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Changes the current user’s NetSuite email address (user name).

Returns

void

Supported Script Types

Server scripts

For additional information, see SuiteScript 2.x Script Types.

Governance

10 units

Module

N/auth Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.newEmail

string

required

The logged in user’s NetSuite new email address.

options.password

string

required

The logged in user’s current NetSuite password.

options.onlyThisAccount

boolean

optional

Determines which accounts the email address is changed for. If set to true, the email address change is applied only to roles within the current account. If set to false, the email address change is applied to all accounts and roles.

The default value is true.

Errors

Error Code

Thrown If

INVALID_EMAIL

The options.newEmail is invalid.

INVALID_PSWD

The options.password does not conform to the password rules.

See Creating a Strong Password for information about valid passwords.

SSS_MISSING_REQD_PARAMETER

The options.newEmail or options.password parameter is not specified.

WRONG_PARAMETER_TYPE

The options.onlyThisAccount is not specified as a boolean value.

Syntax
Important:

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

          //Add additional code 
...
auth.changeEmail({
    password: 'mycurrentPWD',
    newEmail: 'jwolf@netsuite.com',
    onlyThisAccount: true
});
...
//Add additional code 

        

Related Topics

N/auth Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices