> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSAssociate

> Carrier object for Associate.

Carrier object for Associate.

## Constructors

### NSAssociate()

```crmscript theme={null}
NSAssociate
```

Initializes a new instance of the NSAssociate class.

## Methods

## GetAssociateId()

```crmscript theme={null}
Integer GetAssociateId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer associateId = thing.GetAssociateId();
```

## GetDeleted()

```crmscript theme={null}
Bool GetDeleted()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - If true, the user is retired and should have no rights, not appear in lists, and so on.

**Example:**

```crmscript theme={null}
NSAssociate thing;
Bool deleted = thing.GetDeleted();
```

## GetEjUserId()

```crmscript theme={null}
Integer GetEjUserId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of the ej user record corresponding to this associate; 0 for associates that are not ej users.

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer ejUserId = thing.GetEjUserId();
```

## GetFormalName()

```crmscript theme={null}
String GetFormalName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The associate's culture formatted formalname (firstname, middleName and lastname, title, mrmrs).

**Example:**

```crmscript theme={null}
NSAssociate thing;
String formalName = thing.GetFormalName();
```

## GetFullName()

```crmscript theme={null}
String GetFullName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The associate's culture formatted fullname (firstname, middleName and lastname).

**Example:**

```crmscript theme={null}
NSAssociate thing;
String fullName = thing.GetFullName();
```

## GetGroupIdx()

```crmscript theme={null}
Integer GetGroupIdx()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary group membership.

<Note>
  See the UserGroupLink database table reference for secondary memberships.
</Note>

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer groupIdx = thing.GetGroupIdx();
```

## GetName()

```crmscript theme={null}
String GetName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Initials, also login name, possibly database user name.

**Example:**

```crmscript theme={null}
NSAssociate thing;
String name = thing.GetName();
```

## GetPersonId()

```crmscript theme={null}
Integer GetPersonId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Owning person record.

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer personId = thing.GetPersonId();
```

## GetRank()

```crmscript theme={null}
Integer GetRank()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Rank order.

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer rank = thing.GetRank();
```

## GetTooltip()

```crmscript theme={null}
String GetTooltip()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Tooltip or other description.

**Example:**

```crmscript theme={null}
NSAssociate thing;
String tooltip = thing.GetTooltip();
```

## GetType()

```crmscript theme={null}
Integer GetType()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - User type. See \<xref href="CRMScript.NetServer.AssociateType" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer type = thing.GetType();
```

## GetUserName()

```crmscript theme={null}
String GetUserName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - User name.

**Example:**

```crmscript theme={null}
NSAssociate thing;
String userName = thing.GetUserName();
```

## SetAssociateId(Integer)

```crmscript theme={null}
Void SetAssociateId(Integer associateId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer associateId;
thing.SetAssociateId(associateId);
```

## SetDeleted(Bool)

```crmscript theme={null}
Void SetDeleted(Bool deleted)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
Bool deleted;
thing.SetDeleted(deleted);
```

## SetEjUserId(Integer)

```crmscript theme={null}
Void SetEjUserId(Integer ejUserId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer ejUserId;
thing.SetEjUserId(ejUserId);
```

## SetFormalName(String)

```crmscript theme={null}
Void SetFormalName(String formalName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
String formalName;
thing.SetFormalName(formalName);
```

## SetFullName(String)

```crmscript theme={null}
Void SetFullName(String fullName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
String fullName;
thing.SetFullName(fullName);
```

## SetGroupIdx(Integer)

```crmscript theme={null}
Void SetGroupIdx(Integer groupIdx)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

<Note>
  See the UserGroupLink database table reference for secondary memberships
</Note>

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer groupIdx;
thing.SetGroupIdx(groupIdx);
```

## SetName(String)

```crmscript theme={null}
Void SetName(String name)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
String name;
thing.SetName(name);
```

## SetPersonId(Integer)

```crmscript theme={null}
Void SetPersonId(Integer personId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer personId;
thing.SetPersonId(personId);
```

## SetRank(Integer)

```crmscript theme={null}
Void SetRank(Integer rank)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer rank;
thing.SetRank(rank);
```

## SetTooltip(String)

```crmscript theme={null}
Void SetTooltip(String tooltip)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
String tooltip;
thing.SetTooltip(tooltip);
```

## SetType(Integer)

```crmscript theme={null}
Void SetType(Integer type)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
Integer type;
thing.SetType(type);
```

## SetUserName(String)

```crmscript theme={null}
Void SetUserName(String userName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSAssociate thing;
String userName;
thing.SetUserName(userName);
```


## Related topics

- [NSAssociateAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSAssociateAgent.md)
- [NSSelectionEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSSelectionEntity.md)
- [NSEmailFlow](/en/automation/crmscript/reference/CRMScript.NetServer.NSEmailFlow.md)
- [NSQuoteContext](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteContext.md)
- [NSDocumentEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSDocumentEntity.md)
- [NSAppointmentEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSAppointmentEntity.md)
