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

# NSMailMergeTask

> Properties describing a task to create on recipients of a mail merge.

Properties describing a task to create on recipients of a mail merge.

## Constructors

### NSMailMergeTask()

```crmscript theme={null}
NSMailMergeTask
```

Initializes a new instance of the NSMailMergeTask class.

## Methods

## GetCompleted()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Completed status for task.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer completed = thing.GetCompleted();
```

## GetDescription()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Text describing task.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
String description = thing.GetDescription();
```

## GetDuration()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Duration of task.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer duration = thing.GetDuration();
```

## GetOwnerAssociateId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Associate identity of who should be set as owner of the task.

<Note>
  If value is 0, the recipient owner(our contact) will be used.
</Note>

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer ownerAssociateId = thing.GetOwnerAssociateId();
```

## GetPriorityId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Priority of task.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer priorityId = thing.GetPriorityId();
```

## GetProjectId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Project identity to set on task.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer projectId = thing.GetProjectId();
```

## GetSaleId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Sale identity to set on task.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer saleId = thing.GetSaleId();
```

## GetSingleEntryOnEachCompany()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Should we only create one task on each company? If false, separate tasks will be created for all persons from the same company.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Bool singleEntryOnEachCompany = thing.GetSingleEntryOnEachCompany();
```

## GetStartDate()

```crmscript theme={null}
DateTime GetStartDate()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - When the task should start.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
DateTime startDate = thing.GetStartDate();
```

## GetTypeId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Type identity to set on task.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer typeId = thing.GetTypeId();
```

## GetVisibleFor()

```crmscript theme={null}
NSVisibleFor GetVisibleFor()
```

**Returns:** [CRMScript.NetServer.NSVisibleFor](CRMScript.NetServer.NSVisibleFor) - Who the task should be visible for.

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
NSVisibleFor visibleFor = thing.GetVisibleFor();
```

## SetCompleted(Integer)

```crmscript theme={null}
Void SetCompleted(Integer completed)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer completed;
thing.SetCompleted(completed);
```

## SetDescription(String)

```crmscript theme={null}
Void SetDescription(String description)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
String description;
thing.SetDescription(description);
```

## SetDuration(Integer)

```crmscript theme={null}
Void SetDuration(Integer duration)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer duration;
thing.SetDuration(duration);
```

## SetOwnerAssociateId(Integer)

```crmscript theme={null}
Void SetOwnerAssociateId(Integer ownerAssociateId)
```

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

<Note>
  If value is 0, the recipient owner(our contact) will be used.
</Note>

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer ownerAssociateId;
thing.SetOwnerAssociateId(ownerAssociateId);
```

## SetPriorityId(Integer)

```crmscript theme={null}
Void SetPriorityId(Integer priorityId)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer priorityId;
thing.SetPriorityId(priorityId);
```

## SetProjectId(Integer)

```crmscript theme={null}
Void SetProjectId(Integer projectId)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer projectId;
thing.SetProjectId(projectId);
```

## SetSaleId(Integer)

```crmscript theme={null}
Void SetSaleId(Integer saleId)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer saleId;
thing.SetSaleId(saleId);
```

## SetSingleEntryOnEachCompany(Bool)

```crmscript theme={null}
Void SetSingleEntryOnEachCompany(Bool singleEntryOnEachCompany)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Bool singleEntryOnEachCompany;
thing.SetSingleEntryOnEachCompany(singleEntryOnEachCompany);
```

## SetStartDate(DateTime)

```crmscript theme={null}
Void SetStartDate(DateTime startDate)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
DateTime startDate;
thing.SetStartDate(startDate);
```

## SetTypeId(Integer)

```crmscript theme={null}
Void SetTypeId(Integer typeId)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
Integer typeId;
thing.SetTypeId(typeId);
```

## SetVisibleFor(NSVisibleFor)

```crmscript theme={null}
Void SetVisibleFor(NSVisibleFor visibleFor)
```

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

**Example:**

```crmscript theme={null}
NSMailMergeTask thing;
NSVisibleFor visibleFor;
thing.SetVisibleFor(visibleFor);
```


## Related topics

- [NSMailMergeSettings](/en/automation/crmscript/reference/CRMScript.NetServer.NSMailMergeSettings.md)
- [NSSelectionAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSSelectionAgent.md)
- [Enum TaskType](/en/automation/crmscript/reference/CRMScript.NetServer.TaskType.md)
- [Enum values for TaskType](/en/database/tables/enums/tasktype.md)
- [SuperOffice.WebApi.Data.TaskType](/en/api/reference/webapi/SuperOffice.WebApi.Data.TaskType.md)
- [mergedocument](/en/api/mdo-providers/reference/mergedocument.md)
