Codeunit "No. Series - Batch"
Provides an interface for interacting with number series. This codeunit batches requests until SaveState() is called. For more direct database interactions, see codeunit "No. Series".
Properties
| Name | Value |
|---|---|
| Access | Public |
| InherentEntitlements | X |
| InherentPermissions | X |
Methods
GetNextNo
Get the next number in the No. Series. This function finds the first valid No. Series line based on WorkDate and calls the No. Series Line implementation to get the next number. Defaults UsageDate to WorkDate.
procedure GetNextNo(NoSeriesCode: Code[20]): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The next number in the series. |
GetNextNo
Get the next number in the No. Series. This function finds the first valid No. Series line based on UsageDate and calls the No. Series Line implementation to get the next number.
procedure GetNextNo(NoSeriesCode: Code[20], UsageDate: Date): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
| UsageDate | Date |
The date of retrieval, this will influence which line is used. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The next number in the series. |
GetNextNo
Get the next number in the No. Series. This function uses the specified No. Series line and calls the No. Series Line implementation to get the next number.
procedure GetNextNo(var NoSeriesLine: Record "No. Series Line", UsageDate: Date): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No. Series line to use. |
| UsageDate | Date |
The last date used, this will influence which line is used. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The next number in the series. |
GetNextNo
Get the next number in the No. Series. This function finds the first valid No. Series line based on UsageDate and calls the No. Series Line implementation to get the next number.
procedure GetNextNo(NoSeriesCode: Code[20], UsageDate: Date, HideErrorsAndWarnings: Boolean): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
| UsageDate | Date |
The date of retrieval, this will influence which line is used. |
| HideErrorsAndWarnings | Boolean |
Whether errors should be ignored. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The next number in the series, if HideErrorsAndWarnings is true and errors occur, a blank code is returned. |
GetNextNo
Get the next number in the No. Series. This function uses the specified No. Series line and calls the No. Series Line implementation to get the next number.
procedure GetNextNo(var NoSeriesLine: Record "No. Series Line", UsageDate: Date, HideErrorsAndWarnings: Boolean): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No. Series line to use. |
| UsageDate | Date |
The date of retrieval, this will influence which line is used. |
| HideErrorsAndWarnings | Boolean |
Whether errors should be ignored. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The next number in the series, if HideErrorsAndWarnings is true and errors occur, a blank code is returned. |
PeekNextNo
Get the next number in the No. Series, without incrementing the number. This function finds the first valid No. Series line based on WorkDate and calls the No. Series Line implementation to peek the next number. Defaults UsageDate to WorkDate.
procedure PeekNextNo(NoSeriesCode: Code[20]): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The next number in the series. |
PeekNextNo
Get the next number in the No. Series, without incrementing the number. This function finds the first valid No. Series line based on UsageDate and calls the No. Series Line implementation to peek the next number.
procedure PeekNextNo(NoSeriesCode: Code[20], UsageDate: Date): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
| UsageDate | Date |
The date of retrieval, this will influence which line is used. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The next number in the series. |
PeekNextNo
Get the next number in the No. Series, without incrementing the number. This function uses the specified No. Series line and calls the No. Series Line implementation to peek the next number.
procedure PeekNextNo(NoSeriesLine: Record "No. Series Line", UsageDate: Date): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No. Series line to use. |
| UsageDate | Date |
The date of retrieval, this will influence which line is used. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The next number in the series. |
GetLastNoUsed
Get the last number used in the No. Series.
procedure GetLastNoUsed(NoSeriesCode: Code[20]): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The last number used in the series. |
GetLastNoUsed
Get the last number used in the No. Series.
procedure GetLastNoUsed(var NoSeriesLine: Record "No. Series Line"): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No. Series line to use. |
Returns
| Type | Description |
|---|---|
| Code[20] |
The last number used in the series. |
TestManual
Verifies that the No. Series allows using manual numbers.
procedure TestManual(NoSeriesCode: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
TestManual
Verifies that the No. Series allows using manual numbers and throws an error for the document no. if it does not.
procedure TestManual(NoSeriesCode: Code[20], DocumentNo: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
| DocumentNo | Code[20] |
Document No. to be shown in the error message. |
SimulateGetNextNo
Simulate the specified No. Series at the specified date starting with the indicated number.
procedure SimulateGetNextNo(NoSeriesCode: Code[20], UsageDate: Date, LastNoUsed: Code[20]): Code[20]
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
| UsageDate | Date |
The date of retrieval, this will influence which line is used. |
| LastNoUsed | Code[20] |
Simulate this is the last number used. |
Returns
| Type | Description |
|---|---|
| Code[20] |
SetSimulationMode
Puts the codeunit in simulation mode which disables the ability to save state.
procedure SetSimulationMode()
SaveState
Save the state of the No. Series Line to the database.
procedure SaveState(TempNoSeriesLine: Record "No. Series Line" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| TempNoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
No. Series Line we want to save state for. |
SaveState
Save all changes to the database.
procedure SaveState()