> ## 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.

# NSAssociateAgent

> Associate utilities, notes, not user administration.

Associate utilities, notes, not user administration.

## Constructors

### NSAssociateAgent()

```crmscript theme={null}
NSAssociateAgent
```

## Methods

## GetAssociate(Integer)

Gets an NSAssociate object.

```crmscript theme={null}
NSAssociate GetAssociate(Integer associateId)
```

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate)

**Example:**

```crmscript theme={null}
NSAssociateAgent agent;
NSAssociate thing = agent.GetAssociate(123);
```

## GetAssociateByPersonId(Integer)

Returns the associate that belongs to this person if the person is an associate.

```crmscript theme={null}
NSAssociate GetAssociateByPersonId(Integer personId)
```

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate) - The associate that belongs to this person if the person is an associate.

**Example:**

```crmscript theme={null}
NSAssociateAgent agent;
Integer personId;
NSAssociate res = agent.GetAssociateByPersonId(personId);
```

## GetAssociateList(Integer\[])

Retrieves a list of associates.

```crmscript theme={null}
NSAssociate[] GetAssociateList(Integer[] associateIds)
```

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate)\[]

**Example:**

```crmscript theme={null}
Integer[] ids;
NSAssociateAgent agent;
agent.GetAssociateList(ids);
```

## GetAssociatesByGroup(Integer,Integer)

Returns a array of associate based on DiaryGroupType and groupId.

```crmscript theme={null}
NSAssociate[] GetAssociatesByGroup(Integer groupId, Integer type)
```

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate)\[]

**Example:**

```crmscript theme={null}
NSAssociateAgent agent;
Integer groupId;
Integer type;
NSAssociate[] res = agent.GetAssociatesByGroup(groupId, type);
```

## GetNote(Integer)

Returns an array of strings(notepad pages).

```crmscript theme={null}
String[] GetNote(Integer associateId)
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)\[]

**Example:**

```crmscript theme={null}
NSAssociateAgent agent;
Integer associateId;
String[] res = agent.GetNote(associateId);
```

## LogOffWindowsUsers(Integer\[])

Logs off associates that are logged on to the Win client

```crmscript theme={null}
Void LogOffWindowsUsers(Integer[] associateIds)
```

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

**Example:**

```crmscript theme={null}
NSAssociateAgent agent;
Integer[] associateIds;
agent.LogOffWindowsUsers(associateIds);
```

## SaveNote(Integer,String\[])

Saves an array of strings(notepad pages).

```crmscript theme={null}
Void SaveNote(Integer associateId, String[] note)
```

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


## Related topics

- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [SuperOffice.WebApi.Agents.AssociateAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.AssociateAgent.md)
- [SuperOffice.WebApi.Agents.IAssociateAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IAssociateAgent.md)
- [associate](/en/api/mdo-providers/reference/associate.md)
- [Get Associate](/en/api/reference/restful/agent/associate_agent/get-associate.md)
- [Associate](/en/api/search/odata/associate.md)
