saveUser

Saves changes made to a user record and unlocks the record. Use editUser or editUserByRecordID to start the editing process.

A SOAP error envelope is returned if the operation fails. If the operation fails, use cancelSaveUser to unlock the record instead.

Parameters

Parameter Type Description
cookie long Session cookie returned by projectLogon.
firstName string User’s first name.
middleInitials string User’s middle initials.
lastName string User’s last name.
pUser CUser Edited user to save.

Return value

Value Type Notes
result int 0 indicates success. Check the return value in case of an error.

Example

CUser usr = ttsdk.editUser(cookie, "Firstname", "", "Lastname");

 

try

{

usr.middleinitials = "M";

 

// The following line throws an exception if the operation fails.

ttsdk.saveUser(cookie, usr.firstname, usr.middleinitials, usr.lastname, usr);

}

catch (Exception e)

{

// The following operation unlocks the record.

ttsdk.cancelSaveUser(cookie, usr.recordid);

}