createUser()

Adds a User object.

Syntax

            UpdateResult[] createUserResults = stub.createUser(oaUser[] users, oaCompany[] company); 

          

Usage

Use the createUser() command to add one or more new User objects. The maximum number of objects you can add with one single call is 1,000.

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 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 OpenAir 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 OpenAir licensing and compliance, see Licenses.

Arguments

Name

Type

Description

users

oaUser[]

Array of oaUser objects (see User)

company

oaCompany[1]

Array of oaCompany objects (see Company)

Response

UpdateResult[] — Array of UpdateResult objects.

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 = "userA";
newUser.role_id = "1"; // role of administrator.
newUser.password = "*****";
newUser.addr_email = "sss@sss.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("openair"); // specify nickname of the account
the user is being added to.
cuser.setNickname("userA");
cuser.setRole_id("1"); // role of administrator.
cuser.setPassword("******");
cuser.setAddr_email("sss@sss.com");
cuser.setAccount_workscheduleid("1"); // Associate a valid workschedule for the user.

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