Codeunit "Sequence No. Mgt."
Properties
| Name | Value |
|---|---|
| SingleInstance | True |
| InherentPermissions | X |
Methods
ClearState
Clears allocations and other internal states
procedure ClearState()
AllocateSeqNoBuffer
Allocates sequence numbers for a given table ID. if the sequence does not exist, it will be created.
procedure AllocateSeqNoBuffer(TableNo: Integer, NoOfEntries: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
The ID of the table being checked |
| NoOfEntries | Integer |
The ID of the table being checked |
GetNextSeqNo
Returns the next buffered NumberSequence value for a given table ID. if the sequence does not exist, it will be created.
procedure GetNextSeqNo(TableNo: Integer): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
The ID of the table being checked |
Returns
| Type | Description |
|---|---|
| Integer |
GetCurrentSeqNo
Returns the current NumberSequence value for a given table ID. if the sequence does not exist, it will be created.
procedure GetCurrentSeqNo(TableNo: Integer): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
The ID of the table being checked |
Returns
| Type | Description |
|---|---|
| Integer |
ValidateSeqNo
Ensures that the NumberSequence is not behind the last entry in the table. if the sequence does not exist, it will be created. The result will be cached for the current transaction. The cache can be cleared by calling ClearSequenceNoCheck.
procedure ValidateSeqNo(TableNo: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
The ID of the table being checked |
ClearSequenceNoCheck
Clears the cache that is used by procedure ValidateSeqNo(TableNo).
procedure ClearSequenceNoCheck()
RebaseSeqNo
Restarts or recreates the NumberSequence for the specified Table ID.
procedure RebaseSeqNo(TableNo: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
The ID of the table being checked |
GetTableSequenceName
Returns the name of the NumberSequence for the specified Table ID.
procedure GetTableSequenceName(TableNo: Integer): Text
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
The ID of the table being checked |
Returns
| Type | Description |
|---|---|
| Text |
GetTableSequenceName
Returns the name of the NumberSequence for the specified Table ID. We have one sequence for preview and one for non-preview.
procedure GetTableSequenceName(PreviewMode: Boolean, TableNo: Integer): Text
Parameters
| Name | Type | Description |
|---|---|---|
| PreviewMode | Boolean |
Is true for posting preview |
| TableNo | Integer |
The ID of the table being checked |
Returns
| Type | Description |
|---|---|
| Text |
Events
OnPreviewableLedgerEntry
[IntegrationEvent(False,False)]
local procedure OnPreviewableLedgerEntry(TableNo: Integer, var IsPreviewable: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer | |
| IsPreviewable | Boolean |