createUser()

Adds a User object.

Syntax

The syntax and argument table below use the rpc-encoded WSDL. The wrapped document-literal WSDL accepts one oaUser object.

            UpdateResult createUserResult = stub.createUser(oaUser user, oaCompany company); 

          

Usage

Use the createUser() command to add one new User object per call.

To add objects of types other than User, use the add() command instead.

You can set custom field values as well as standard field values when adding User objects. See Reading or Setting Custom Field Values Inline.

You can set the employee work schedules when adding User objects.

Important:

Review the following guidelines:

  • You must be authenticated as an account administrator or have the View, modify, and create new users role permission to use the createUser() command.

  • The createUser() command does not support foreign key lookup.

  • You must set a password when using the createUser command to create a new user record except for generic user records (generic set to 1).

  • The following applies if you are using SAML for authentication in to your SuiteProjects Pro account. You can set a password and enable SAML authentication for the user (setting the Boolean custom field saml_auth__c to true) when using the createUser() command to create a new user record.

  • Limits are enforced to prevent you from creating or activating users if doing so would exceed the number of user licenses purchased for your account. If no user licenses of the appropriate type are available, the createUser() command creates a new user record, but sets it as inactive (clears the Active box on the employee record). For more information about SuiteProjects Pro licensing and compliance, see Licenses.

Arguments

Name

Type

Description

user

oaUser

An oaUser object (see User)

company

oaCompany

An oaCompany object (see Company)

Response

UpdateResult - An UpdateResult object.

Sample Code - C#

            oaCompany comp = new oaCompany();
comp.nickname = "New Account";// specify nickname of the account the
user is being added to.

oaUser newUser = new oaUser();
newUser.nickname = "mcollins";
newUser.role_id = "1"; // role of administrator.
newUser.password = "new_user_password";
newUser.addr_email = "jsmith@example.com";
newUser.account_workscheduleid = "1"; // Associate a valid workschedule for the user.

UpdateResult result = _svc.createUser(newUser, comp); 

          

Sample Code - Java

            oaCompany comp = new oaCompany();
oaUser cuser = new oaUser();
comp.setNickname("companyID"); // specify nickname of the account
the user is being added to.
cuser.setNickname("mcollins");
cuser.setRole_id("1"); // role of administrator.
cuser.setPassword("new_user_password");
cuser.setAddr_email("mcollins@example.com");
cuser.setAccount_workscheduleid("1"); // Associate a valid workschedule for the user.

UpdateResult result = stub.createUser(cuser, comp);