Class NSUser

SuperOffice User, with login credentials and an associated person.

Constructors

NSUser()

Initializes a new instance of the NSUser class.

Declaration

NSUser

Methods

GetAssociateId()

Declaration

Integer GetAssociateId()

Examples

NSUser thing;
Integer associateId = thing.GetAssociateId();

Returns

Type Description
Integer Primary key.

GetCredentials()

Declaration

NSCredential[] GetCredentials()

Examples

NSUser thing;
NSCredential[] credentials = thing.GetCredentials();

Returns

Type Description
NSCredential[] List of credentials registered for this user. i.e. valid authentication methods.

GetCustomFields()

Gets the user-defined + extra fields on a User as a map.

Declaration

Map GetCustomFields()

Examples

NSUser thing;
Map fields = thing.GetCustomFields();
String oldValue = fields.get("SuperOffice:1");
fields.insert("SuperOffice:1", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
  printLine(fields.getKey() + ":  " + fields.getVal());

Returns

Type Description
Map

GetDeleted()

Declaration

Bool GetDeleted()

Examples

NSUser thing;
Bool deleted = thing.GetDeleted();

Returns

Type Description
Bool If true, the user is retired and should have no rights, not appear in lists, etc.

GetEjUserId()

Declaration

Integer GetEjUserId()

Examples

NSUser thing;
Integer ejUserId = thing.GetEjUserId();

Returns

Type Description
Integer ID of the ej user record corresponding to this associate; 0 for associates that are not ej users.

GetExtraFields()

Gets the extra fields on User as a map.

Declaration

Map GetExtraFields()

Examples

NSUser thing;
Map fields = thing.GetExtraFields();
String oldValue = fields.get("x_foobar");
fields.insert("x_foobar", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
  printLine(fields.getKey() + ":  " + fields.getVal());

Returns

Type Description
Map

GetIsOnTravel()

Declaration

Bool GetIsOnTravel()

Examples

NSUser thing;
Bool isOnTravel = thing.GetIsOnTravel();

Returns

Type Description
Bool True if the user is on travel.

GetIsPersonRetired()

Declaration

Bool GetIsPersonRetired()

Examples

NSUser thing;
Bool isPersonRetired = thing.GetIsPersonRetired();

Returns

Type Description
Bool True if the user is retired and should have no rights, not appear in lists, etc.

GetLastlogin()

Declaration

DateTime GetLastlogin()

Examples

NSUser thing;
DateTime lastlogin = thing.GetLastlogin();

Returns

Type Description
DateTime Last login date.

GetLastlogout()

Declaration

DateTime GetLastlogout()

Examples

NSUser thing;
DateTime lastlogout = thing.GetLastlogout();

Returns

Type Description
DateTime Last logout date.

GetLicenseOwners()

Declaration

NSLicenseOwner[] GetLicenseOwners()

Examples

NSUser thing;
NSLicenseOwner[] licenseOwners = thing.GetLicenseOwners();

Returns

Type Description
NSLicenseOwner[] The restricted and unrestricted module licenses grouped by license owner.

GetName()

Declaration

String GetName()

Examples

NSUser thing;
String name = thing.GetName();

Returns

Type Description
String Initials, UserId* also used as login name for on-site installations. Identifies user in archives.

GetNickName()

Declaration

String GetNickName()

Examples

NSUser thing;
String nickName = thing.GetNickName();

Returns

Type Description
String The unique nick name for this user. Used in Service as an alias, similar to Name/Initials.

GetOtherGroups()

Declaration

NSUserGroup[] GetOtherGroups()

Examples

NSUser thing;
NSUserGroup[] otherGroups = thing.GetOtherGroups();

Returns

Type Description
NSUserGroup[] The other groups this user is a member of, apart from the main user group.

GetPerson()

Declaration

NSPerson GetPerson()

Examples

NSUser thing;
NSPerson person = thing.GetPerson();

Returns

Type Description
NSPerson The person associated with this user. Detailed information about the user.

GetRank()

Declaration

Integer GetRank()

Examples

NSUser thing;
Integer rank = thing.GetRank();

Returns

Type Description
Integer Rank order.

GetRequestSignature()

Declaration

String GetRequestSignature()

Examples

NSUser thing;
String requestSignature = thing.GetRequestSignature();

Returns

Type Description
String ej users request signature.

GetRole()

Declaration

NSRole GetRole()

Examples

NSUser thing;
NSRole role = thing.GetRole();

Returns

Type Description
NSRole Users role for role-based security. Determines permissions and access rights for the user.

GetTicketCategories()

Declaration

NSMDOListItem[] GetTicketCategories()

Examples

NSUser thing;
NSMDOListItem[] ticketCategories = thing.GetTicketCategories();

Returns

Type Description
NSMDOListItem[] Request Ticket Categories assigned to the user.

GetTooltip()

Declaration

String GetTooltip()

Examples

NSUser thing;
String tooltip = thing.GetTooltip();

Returns

Type Description
String Tooltip or other description.

GetType()

Declaration

Integer GetType()

Examples

NSUser thing;
Integer type = thing.GetType();

Returns

Type Description
Integer NSUser type 1=InternalAssociate, 2=ResourceAssociate, 3=ExternalAssociate, 4=AnonymousAssociate, 5=SystemAssociate.

GetUserGroup()

Declaration

NSUserGroup GetUserGroup()

Examples

NSUser thing;
NSUserGroup userGroup = thing.GetUserGroup();

Returns

Type Description
NSUserGroup The main user group that this user belongs to.

GetUserName()

Declaration

String GetUserName()

Examples

NSUser thing;
String userName = thing.GetUserName();

Returns

Type Description
String User name, a.k.a. Login name. This might be an email address.

GetWaitingForApproval()

Declaration

Bool GetWaitingForApproval()

Examples

NSUser thing;
Bool waitingForApproval = thing.GetWaitingForApproval();

Returns

Type Description
Bool The user is waiting for an administrator to approve/grant her/him access.

SetAssociateId(Integer)

Declaration

Void SetAssociateId(Integer associateId)

Examples

NSUser thing;
Integer associateId;
thing.SetAssociateId(associateId);

Parameters

Type Name Description
Integer associateId Primary key.

Returns

Type Description
Void

SetCredentials(NSCredential[])

Declaration

Void SetCredentials(NSCredential[] credentials)

Examples

NSUser thing;
NSCredential[] credentials;
thing.SetCredentials(credentials);

Parameters

Type Name Description
NSCredential[] credentials List of credentials registered for this user. i.e. valid authentication methods.

Returns

Type Description
Void

SetCustomFields(Map)

Sets the user-defined and extra fields on a User with a map.

Declaration

Void SetCustomFields(Map udefs)

Examples

NSUser thing;
Map udefs;
udefs["SuperOffice:1"] = "[I:123]";
udefs["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
udefs["custom.progid"] = "foobar";
udefs["x_foo"] = "foobar";
udefs["x_bar"] = "456"; // List item id
thing.SetCustomFields(udefs);

Parameters

Type Name Description
Map udefs

Returns

Type Description
Void

SetDeleted(Bool)

Declaration

Void SetDeleted(Bool deleted)

Examples

NSUser thing;
Bool deleted;
thing.SetDeleted(deleted);

Parameters

Type Name Description
Bool deleted If true, the user is retired and should have no rights, not appear in lists, etc.

Returns

Type Description
Void

SetEjUserId(Integer)

Declaration

Void SetEjUserId(Integer ejUserId)

Examples

NSUser thing;
Integer ejUserId;
thing.SetEjUserId(ejUserId);

Parameters

Type Name Description
Integer ejUserId ID of the ej user record corresponding to this associate; 0 for associates that are not ej users.

Returns

Type Description
Void

SetExtraFields(Map)

Sets the extra field values on User with a map.

Declaration

Void SetExtraFields(Map extras)

Examples

NSUser thing;
Map extras;
extras["SuperOffice:1"] = "[I:123]";
extras["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
extras["custom.progid"] = "foobar";
thing.SetExtraFields(extras);

Parameters

Type Name Description
Map extras

Returns

Type Description
Void

SetIsOnTravel(Bool)

Declaration

Void SetIsOnTravel(Bool isOnTravel)

Examples

NSUser thing;
Bool isOnTravel;
thing.SetIsOnTravel(isOnTravel);

Parameters

Type Name Description
Bool isOnTravel True if the user is on travel.

Returns

Type Description
Void

SetIsPersonRetired(Bool)

Declaration

Void SetIsPersonRetired(Bool isPersonRetired)

Examples

NSUser thing;
Bool isPersonRetired;
thing.SetIsPersonRetired(isPersonRetired);

Parameters

Type Name Description
Bool isPersonRetired True if the user is retired and should have no rights, not appear in lists, etc.

Returns

Type Description
Void

SetLastlogin(DateTime)

Declaration

Void SetLastlogin(DateTime lastlogin)

Examples

NSUser thing;
DateTime lastlogin;
thing.SetLastlogin(lastlogin);

Parameters

Type Name Description
DateTime lastlogin Last login date.

Returns

Type Description
Void

SetLastlogout(DateTime)

Declaration

Void SetLastlogout(DateTime lastlogout)

Examples

NSUser thing;
DateTime lastlogout;
thing.SetLastlogout(lastlogout);

Parameters

Type Name Description
DateTime lastlogout Last logout date.

Returns

Type Description
Void

SetLicenseOwners(NSLicenseOwner[])

Declaration

Void SetLicenseOwners(NSLicenseOwner[] licenseOwners)

Examples

NSUser thing;
NSLicenseOwner[] licenseOwners;
thing.SetLicenseOwners(licenseOwners);

Parameters

Type Name Description
NSLicenseOwner[] licenseOwners The restricted and unrestricted module licenses grouped by license owner.

Returns

Type Description
Void

SetName(String)

Declaration

Void SetName(String name)

Examples

NSUser thing;
String name;
thing.SetName(name);

Parameters

Type Name Description
String name Initials, UserId* also used as login name for on-site installations. Identifies user in archives.

Returns

Type Description
Void

SetNickName(String)

Declaration

Void SetNickName(String nickName)

Examples

NSUser thing;
String nickName;
thing.SetNickName(nickName);

Parameters

Type Name Description
String nickName The unique nick name for this user. Used in Service as an alias, similar to Name/Initials.

Returns

Type Description
Void

SetOtherGroups(NSUserGroup[])

Declaration

Void SetOtherGroups(NSUserGroup[] otherGroups)

Examples

NSUser thing;
NSUserGroup[] otherGroups;
thing.SetOtherGroups(otherGroups);

Parameters

Type Name Description
NSUserGroup[] otherGroups The other groups this user is a member of, apart from the main user group.

Returns

Type Description
Void

SetPerson(NSPerson)

Declaration

Void SetPerson(NSPerson person)

Examples

NSUser thing;
NSPerson person;
thing.SetPerson(person);

Parameters

Type Name Description
NSPerson person The person associated with this user. Detailed information about the user.

Returns

Type Description
Void

SetRank(Integer)

Declaration

Void SetRank(Integer rank)

Examples

NSUser thing;
Integer rank;
thing.SetRank(rank);

Parameters

Type Name Description
Integer rank Rank order.

Returns

Type Description
Void

SetRequestSignature(String)

Declaration

Void SetRequestSignature(String requestSignature)

Examples

NSUser thing;
String requestSignature;
thing.SetRequestSignature(requestSignature);

Parameters

Type Name Description
String requestSignature ej users request signature.

Returns

Type Description
Void

SetRole(NSRole)

Declaration

Void SetRole(NSRole role)

Examples

NSUser thing;
NSRole role;
thing.SetRole(role);

Parameters

Type Name Description
NSRole NSRole Users role for role-based security. Determines permissions and access rights for the user.

Returns

Type Description
Void

SetTicketCategories(NSMDOListItem[])

Declaration

Void SetTicketCategories(NSMDOListItem[] ticketCategories)

Examples

NSUser thing;
NSMDOListItem[] ticketCategories;
thing.SetTicketCategories(ticketCategories);

Parameters

Type Name Description
NSMDOListItem[] ticketCategories Request Ticket Categories assigned to the user.

Returns

Type Description
Void

SetTooltip(String)

Declaration

Void SetTooltip(String tooltip)

Examples

NSUser thing;
String tooltip;
thing.SetTooltip(tooltip);

Parameters

Type Name Description
String tooltip Tooltip or other description.

Returns

Type Description
Void

SetType(Integer)

Declaration

Void SetType(Integer type)

Examples

NSUser thing;
Integer type;
thing.SetType(type);

Parameters

Type Name Description
Integer type NSUser type 1=InternalAssociate, 2=ResourceAssociate, 3=ExternalAssociate, 4=AnonymousAssociate, 5=SystemAssociate See <xref href="CRMScript.NetServer.AssociateType" data-throw-if-not-resolved="false"></xref>.

Returns

Type Description
Void

SetUserGroup(NSUserGroup)

Declaration

Void SetUserGroup(NSUserGroup userGroup)

Examples

NSUser thing;
NSUserGroup userGroup;
thing.SetUserGroup(userGroup);

Parameters

Type Name Description
NSUserGroup userGroup The main user group that this user belongs to.

Returns

Type Description
Void

SetUserName(String)

Declaration

Void SetUserName(String userName)

Examples

NSUser thing;
String userName;
thing.SetUserName(userName);

Parameters

Type Name Description
String userName User name, a.k.a. Login name. This might be an email address.

Returns

Type Description
Void

SetWaitingForApproval(Bool)

Declaration

Void SetWaitingForApproval(Bool waitingForApproval)

Examples

NSUser thing;
Bool waitingForApproval;
thing.SetWaitingForApproval(waitingForApproval);

Parameters

Type Name Description
Bool waitingForApproval The user is waiting for an administrator to approve/grant her/him access.

Returns

Type Description
Void