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

# NSHistoryRequest

> Specification for a request for history information, by ID. It is possible to ask for rights for a new record (insert), but then you need to supply the parent ID for entities that have parents (projectmember, selectionmember, person).

Specification for a request for history information, by ID. It is possible to ask for rights for a new record (insert), but then you need to supply the parent ID for entities that have parents (projectmember, selectionmember, person).

## Constructors

### NSHistoryRequest()

```crmscript theme={null}
NSHistoryRequest
```

Initializes a new instance of the NSHistoryRequest class.

## Methods

## GetEntityName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of entity to get history for.

**Example:**

```crmscript theme={null}
NSHistoryRequest thing;
String entityName = thing.GetEntityName();
```

## GetEntityOrParentId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of entity to get history for, or parent entity id if requesting insert rights for an entity that has a parent.

**Example:**

```crmscript theme={null}
NSHistoryRequest thing;
Integer entityOrParentId = thing.GetEntityOrParentId();
```

## GetRequestForNewRecord()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Are we requesting insert rights? If true, then EntityorParentId is taken to mean parent Id.

**Example:**

```crmscript theme={null}
NSHistoryRequest thing;
Bool requestForNewRecord = thing.GetRequestForNewRecord();
```

## SetEntityName(String)

```crmscript theme={null}
Void SetEntityName(String entityName)
```

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

**Example:**

```crmscript theme={null}
NSHistoryRequest thing;
String entityName;
thing.SetEntityName(entityName);
```

## SetEntityOrParentId(Integer)

```crmscript theme={null}
Void SetEntityOrParentId(Integer entityOrParentId)
```

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

**Example:**

```crmscript theme={null}
NSHistoryRequest thing;
Integer entityOrParentId;
thing.SetEntityOrParentId(entityOrParentId);
```

## SetRequestForNewRecord(Bool)

```crmscript theme={null}
Void SetRequestForNewRecord(Bool requestForNewRecord)
```

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

**Example:**

```crmscript theme={null}
NSHistoryRequest thing;
Bool requestForNewRecord;
thing.SetRequestForNewRecord(requestForNewRecord);
```


## Related topics

- [NSViewStateAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSViewStateAgent.md)
- [SuperOffice.WebApi.Data.HistoryRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.HistoryRequest.md)
- [SuperOffice.WebApi.Data.MDO GetListWithHistoryRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.MDO_GetListWithHistoryRequest.md)
- [SuperOffice.WebApi.Data.ViewState SaveHistoriesRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.ViewState_SaveHistoriesRequest.md)
- [SuperOffice.WebApi.Data.Targets GetTargetRevisionHistoryRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Targets_GetTargetRevisionHistoryRequest.md)
- [SuperOffice.WebApi.Data.ViewState GetHistoriesRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.ViewState_GetHistoriesRequest.md)
