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

# SuperOffice.WebApi.Agents.INumberAllocationAgent

# \<a id="SuperOffice\_WebApi\_Agents\_INumberAllocationAgent">\</a> Interface INumberAllocationAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

This agent can be used to manage number allocation

```csharp theme={null}
public interface INumberAllocationAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_INumberAllocationAgent\_CreateDefaultRefCountEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultRefCountEntityAsync(RequestOptions)

Set default values into a new RefCountEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<RefCountEntity> CreateDefaultRefCountEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[RefCountEntity](SuperOffice.WebApi.Data.RefCountEntity.md)\&gt;

A blank RefCountEntity

### \<a id="SuperOffice\_WebApi\_Agents\_INumberAllocationAgent\_DeleteRefCountEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteRefCountEntityAsync(int, RequestOptions)

Deletes the RefCountEntity

```csharp theme={null}
Task DeleteRefCountEntityAsync(int refCountEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`refCountEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the RefCountEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_INumberAllocationAgent\_GetNumberEachTemplateAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetNumberEachTemplateAsync(RequestOptions)

Returns true or false if Automatically create new counters for new document templates

```csharp theme={null}
Task<bool> GetNumberEachTemplateAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Is NumberEachTemplate?

### \<a id="SuperOffice\_WebApi\_Agents\_INumberAllocationAgent\_GetRefCountEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetRefCountEntityAsync(int, RequestOptions)

Gets a specific RefCountEntity object.

```csharp theme={null}
Task<RefCountEntity> GetRefCountEntityAsync(int refCountEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`refCountEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the RefCountEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[RefCountEntity](SuperOffice.WebApi.Data.RefCountEntity.md)\&gt;

RefCountEntity

### \<a id="SuperOffice\_WebApi\_Agents\_INumberAllocationAgent\_SaveDefaultNumberingAsync\_SuperOffice\_WebApi\_Data\_RefCountEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveDefaultNumberingAsync(RefCountEntity, RequestOptions)

Saves default numbering values in preferences

```csharp theme={null}
Task SaveDefaultNumberingAsync(RefCountEntity refCountEntity, RequestOptions requestOptions = null)
```

#### Parameters

`refCountEntity` [RefCountEntity](SuperOffice.WebApi.Data.RefCountEntity.md)

The refCountEntity that holds the values that will be saved

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

void

### \<a id="SuperOffice\_WebApi\_Agents\_INumberAllocationAgent\_SaveRefCountEntityAsync\_SuperOffice\_WebApi\_Data\_RefCountEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveRefCountEntityAsync(RefCountEntity, RequestOptions)

Updates the existing RefCountEntity or creates a new RefCountEntity if the id parameter is 0.

```csharp theme={null}
Task<RefCountEntity> SaveRefCountEntityAsync(RefCountEntity refCountEntity, RequestOptions requestOptions = null)
```

#### Parameters

`refCountEntity` [RefCountEntity](SuperOffice.WebApi.Data.RefCountEntity.md)

The RefCountEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[RefCountEntity](SuperOffice.WebApi.Data.RefCountEntity.md)\&gt;

New or updated RefCountEntity

### \<a id="SuperOffice\_WebApi\_Agents\_INumberAllocationAgent\_SetNumberEachTemplateAsync\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetNumberEachTemplateAsync(bool, RequestOptions)

Saves true or false if Automatically create new counters for new document templates

```csharp theme={null}
Task SetNumberEachTemplateAsync(bool setValue, RequestOptions requestOptions = null)
```

#### Parameters

`setValue` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true or false if Automatically create new counters for new document templates

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

void


## Related topics

- [SuperOffice.WebApi.Agents.NumberAllocationAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.NumberAllocationAgent.md)
- [SuperOffice.WebApi.Data.RefCountEntity](/en/api/reference/webapi/SuperOffice.WebApi.Data.RefCountEntity.md)
- [SuperOffice.WebApi.Data.NumberAllocation GetNumberEachTemplateRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.NumberAllocation_GetNumberEachTemplateRequest.md)
- [SuperOffice.WebApi.Data.NumberAllocation SetNumberEachTemplateRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.NumberAllocation_SetNumberEachTemplateRequest.md)
- [SuperOffice.WebApi.Data.NumberAllocation SaveDefaultNumberingRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.NumberAllocation_SaveDefaultNumberingRequest.md)
- [SuperOffice.WebApi.Agents](/en/api/reference/webapi/SuperOffice.WebApi.Agents.md)
