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

# NSBatchTaskInfo

> Contains information about one batch task.

Contains information about one batch task.

## Constructors

### NSBatchTaskInfo()

```crmscript theme={null}
NSBatchTaskInfo
```

Initializes a new instance of the NSBatchTaskInfo class.

## Methods

## GetAssociateId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Task owner. If it is a System task, AssociateId = 0.

**Example:**

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

## GetContext()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Context for the executing task.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String context = thing.GetContext();
```

## GetCreated()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Task creation time.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
DateTime created = thing.GetCreated();
```

## GetDatabaseSerialNumber()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Serial number of the database the task is to run on.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String databaseSerialNumber = thing.GetDatabaseSerialNumber();
```

## GetDescription()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Description of the task.

**Example:**

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

## GetDetailsRecord()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Record ID of a row in the DetailsTable containing more info about the task.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer detailsRecord = thing.GetDetailsRecord();
```

## GetDetailsTable()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of table with more information about the task.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer detailsTable = thing.GetDetailsTable();
```

## GetId()

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

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer id = thing.GetId();
```

## GetIsInternalTask()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - If true, this task will not add a trace to the database.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Bool isInternalTask = thing.GetIsInternalTask();
```

## GetIsSystemTask()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - If true, the task is not initiated by an associate.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Bool isSystemTask = thing.GetIsSystemTask();
```

## GetLastStarted()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - When was the task last started.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
DateTime lastStarted = thing.GetLastStarted();
```

## GetName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of the task.

**Example:**

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

## GetParameterObject()

```crmscript theme={null}
Map GetParameterObject()
```

**Returns:** [CRMScript.Native.Map](CRMScript.Native.Map) - ParameterObject will be serialized to a binary blob and saved in the BinaryObject table. The link to the BinaryObject will be set using DetailsTable and DetailsRecord.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Map parameterObject = thing.GetParameterObject();
```

## GetProgressDescription()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Descriptive text for the current stage.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String progressDescription = thing.GetProgressDescription();
```

## GetProgressPercent()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Task progress, in percent of estimated total.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer progressPercent = thing.GetProgressPercent();
```

## GetRequest()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Maps to the request field in the batchtask table.

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String request = thing.GetRequest();
```

## GetResponse()

Maps to the response field in the batchtask table.

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

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String response = thing.GetResponse();
```

## GetResult()

Maps to the result field in the batchtask table.

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

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String result = thing.GetResult();
```

## GetStartCount()

Maps to the startcount field in the batchtask table.

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

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer startCount = thing.GetStartCount();
```

## GetState()

BatchTaskState of the task.

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

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer state = thing.GetState();
```

## SetAssociateId(Integer)

Task owner. If it is a System task, AssociateId = 0.

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

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

**Example:**

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

## SetContext(String)

Context for the executing task.

```crmscript theme={null}
Void SetContext(String context)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String context;
thing.SetContext(context);
```

## SetCreated(DateTime)

```crmscript theme={null}
Void SetCreated(DateTime created)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
DateTime created;
thing.SetCreated(created);
```

## SetDatabaseSerialNumber(String)

Serial number of the database the task is to run on.

```crmscript theme={null}
Void SetDatabaseSerialNumber(String databaseSerialNumber)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String databaseSerialNumber;
thing.SetDatabaseSerialNumber(databaseSerialNumber);
```

## SetDescription(String)

Description of the task.

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

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

**Example:**

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

## SetDetailsRecord(Integer)

Record ID of a row in the DetailsTable containing more info about the task.

```crmscript theme={null}
Void SetDetailsRecord(Integer detailsRecord)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer detailsRecord;
thing.SetDetailsRecord(detailsRecord);
```

## SetDetailsTable(Integer)

ID of table with more information about the task.

```crmscript theme={null}
Void SetDetailsTable(Integer detailsTable)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer detailsTable;
thing.SetDetailsTable(detailsTable);
```

## SetId(Integer)

ID of the task.

```crmscript theme={null}
Void SetId(Integer id)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer id;
thing.SetId(id);
```

## SetIsInternalTask(Bool)

If IsInternalTask is true, this task will not add a trace to the database.

```crmscript theme={null}
Void SetIsInternalTask(Bool isInternalTask)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Bool isInternalTask;
thing.SetIsInternalTask(isInternalTask);
```

## SetIsSystemTask(Bool)

If IsSystemTask is true, the task is not initiated by an associate.

```crmscript theme={null}
Void SetIsSystemTask(Bool isSystemTask)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Bool isSystemTask;
thing.SetIsSystemTask(isSystemTask);
```

## SetLastStarted(DateTime)

```crmscript theme={null}
Void SetLastStarted(DateTime lastStarted)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
DateTime lastStarted;
thing.SetLastStarted(lastStarted);
```

## SetName(String)

Name of the task.

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

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

**Example:**

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

## SetParameterObject(Map)

Serializes a Map to a binary blob and saves it in the BinaryObject table. The link to the BinaryObject will be set using DetailsTable and DetailsRecord.

```crmscript theme={null}
Void SetParameterObject(Map parameterObject)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Map parameterObject;
thing.SetParameterObject(parameterObject);
```

## SetProgressDescription(String)

Descriptive text for the current stage

```crmscript theme={null}
Void SetProgressDescription(String progressDescription)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String progressDescription;
thing.SetProgressDescription(progressDescription);
```

## SetProgressPercent(Integer)

Task progress, in percent of estimated total

```crmscript theme={null}
Void SetProgressPercent(Integer progressPercent)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer progressPercent;
thing.SetProgressPercent(progressPercent);
```

## SetRequest(String)

Maps to the request field in the batchtask table.

```crmscript theme={null}
Void SetRequest(String request)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String request;
thing.SetRequest(request);
```

## SetResponse(String)

Maps to the response field in the batchtask table.

```crmscript theme={null}
Void SetResponse(String response)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String response;
thing.SetResponse(response);
```

## SetResult(String)

Maps to the result field in the batchtask table.

```crmscript theme={null}
Void SetResult(String result)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
String result;
thing.SetResult(result);
```

## SetStartCount(Integer)

Maps to the startcount field in the batchtask table.

```crmscript theme={null}
Void SetStartCount(Integer startCount)
```

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

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer startCount;
thing.SetStartCount(startCount);
```

## SetState(Integer)

BatchTaskState of the task.

```crmscript theme={null}
Void SetState(Integer state)
```

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

<Note>
  See \<xref href="CRMScript.NetServer.BatchTaskState" data-throw-if-not-resolved="false">\</xref>
</Note>

**Example:**

```crmscript theme={null}
NSBatchTaskInfo thing;
Integer state;
thing.SetState(state);
```


## Related topics

- [NSBatchAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSBatchAgent.md)
- [NSSaintAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSSaintAgent.md)
- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [NSFreeTextAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSFreeTextAgent.md)
- [Get Batch Task Info](/en/api/reference/restful/rest/batch/get-batch-task-info.md)
