Codeunit "No. Series"
Provides an interface for interacting with No. Series. This codeunit actively uses the database to perform the operations (it does not batch requests). For further performance and batching, look at codeunit "No. Series Batch".
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.
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 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 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 UsageDate and calls the No. Series Line implementation to peek the next number.
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(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 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(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. |
IsManual
Determines whether the No. Series allows using manual numbers.
procedure IsManual(NoSeriesCode: Code[20]): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if the No. Series allows manual numbers, false otherwise. |
TestAutomatic
Verifies that the No. Series is set up to automatically generate numbers.
procedure TestAutomatic(NoSeriesCode: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
IsAutomatic
Determines whether numbers should automatically be generated from the No. Series.
procedure IsAutomatic(NoSeriesCode: Code[20]): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
Code for the No. Series. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if the No. Series is automatic, false otherwise. |
HasRelatedSeries
Returns true if the No. Series is related to one or more other No. Series.
procedure HasRelatedSeries(NoSeriesCode: Code[20]): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
The No. Series code to check |
Returns
| Type | Description |
|---|---|
| Boolean |
True if the No. Series is related to one or more other No. Series. |
TestAreRelated
Verifies that the two No. Series are related.
procedure TestAreRelated(DefaultNoSeriesCode: Code[20], RelatedNoSeriesCode: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| DefaultNoSeriesCode | Code[20] |
The primary No. Series code. |
| RelatedNoSeriesCode | Code[20] |
The No. Series code that is related to the primary No. Series code. |
AreRelated
Determines whether the two No. Series are related.
procedure AreRelated(DefaultNoSeriesCode: Code[20], RelatedNoSeriesCode: Code[20]): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| DefaultNoSeriesCode | Code[20] |
The primary No. Series code. |
| RelatedNoSeriesCode | Code[20] |
The No. Series code that is related to the primary No. Series code. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if the two No. Series are related, false otherwise. |
LookupRelatedNoSeries
Opens a page to select a No. Series related to the OriginalNoSeriesCode (including the OriginalNoSeriesCode).
procedure LookupRelatedNoSeries(OriginalNoSeriesCode: Code[20], var NewNoSeriesCode: Code[20]): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| OriginalNoSeriesCode | Code[20] |
The No. Series code to find related No. Series for. |
| NewNoSeriesCode | Code[20] |
The selected No. Series code. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if a No. Series was selected, false otherwise. |
LookupRelatedNoSeries
Opens a page to select a No. Series related to the OriginalNoSeriesCode (including the OriginalNoSeriesCode).
procedure LookupRelatedNoSeries(OriginalNoSeriesCode: Code[20], DefaultHighlightedNoSeriesCode: Code[20], var NewNoSeriesCode: Code[20]): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| OriginalNoSeriesCode | Code[20] |
The No. Series code to find related No. Series for. |
| DefaultHighlightedNoSeriesCode | Code[20] |
The No. Series code to highlight by default. If empty, the OriginalNoSeriesCode will be used. |
| NewNoSeriesCode | Code[20] |
The selected No. Series code. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if a No. Series was selected, false otherwise. |
DrillDown
Drills down into the No Series Lines for the specified No. Series.
procedure DrillDown(NoSeries: Record "No. Series")
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeries | Table Microsoft.Foundation.NoSeries."No. Series" |
The No. Series record to drill down on. |
MayProduceGaps
Use this method to determine whether the specified No. Series line may produce gaps.
procedure MayProduceGaps(NoSeriesLine: Record "No. Series Line"): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No. Series Line to check. |
Returns
| Type | Description |
|---|---|
| Boolean |
GetNoSeriesLine
Get the No. Series line for the specified No. Series code and usage date.
procedure GetNoSeriesLine(var NoSeriesLine: Record "No. Series Line", NoSeriesCode: Code[20], UsageDate: Date, HideErrorsAndWarnings: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No. Series line to use and return. |
| NoSeriesCode | Code[20] |
The No. Series code to lookup. |
| UsageDate | Date |
The date of retrieval, this will influence which line is used. |
| HideErrorsAndWarnings | Boolean |
Whether errors should be ignored. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if the No. Series line was found, false otherwise. |
Remarks
NoSeriesCode must not be empty.
SelectCurrentNoSeriesLine
Filters the No Series Lines and selects the currently applicable line based on the workdate.
procedure SelectCurrentNoSeriesLine(NoSeries: Record "No. Series", var NoSeriesLine: Record "No. Series Line", ResetFilters: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeries | Table Microsoft.Foundation.NoSeries."No. Series" |
The No. Series for which to select a line. |
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No Series Line is returned filtered and the currently applicable line is selected |
| ResetFilters | Boolean |
If set to true, the filters on the Starting Date and Open fields are reset. The currently applicable line is still selected in the table. |
Returns
| Type | Description |
|---|---|
| Boolean |
Returns true if a line was selected, false if no line was selected. |
IsNoSeriesInDateOrder
Returns true if the number series has Date Order set.
procedure IsNoSeriesInDateOrder(NoSeriesCode: Code[20]): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesCode | Code[20] |
The No. Series code to check. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if the number series is marked for date order, false otherwise. |
Remarks
If Date Order is true, numbers must be retrieved in chronological order.
IsNoSeriesInDateOrder
Returns true if the number series has Date Order set.
procedure IsNoSeriesInDateOrder(NoSeries: Record "No. Series"): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeries | Table Microsoft.Foundation.NoSeries."No. Series" |
The No. Series to check. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if the number series is marked for date order, false otherwise. |
Remarks
If Date Order is true, numbers must be retrieved in chronological order.
Events
OnAfterSetNoSeriesCurrentLineFilters
Use this event to change the filters set on the No. Series Line record. These filters are used when viewing the No. Series page and when drilling down from a No. Series record.
[IntegrationEvent(False,False)]
internal procedure OnAfterSetNoSeriesCurrentLineFilters(NoSeries: Record "No. Series", var NoSeriesLine: Record "No. Series Line", IsDrillDown: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeries | Table Microsoft.Foundation.NoSeries."No. Series" |
The No. Series record to drill down on. |
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No. Series Line to set filters on. |
| IsDrillDown | Boolean |
Specifies whether the filters are being set for a drill down. |
OnSetNoSeriesLineFilters
Use this event to set additional filters on the No. Series Line record. These filters are used when searching the No. Series.
[IntegrationEvent(False,False)]
internal procedure OnSetNoSeriesLineFilters(var NoSeriesLine: Record "No. Series Line")
Parameters
| Name | Type | Description |
|---|---|---|
| NoSeriesLine | Table Microsoft.Foundation.NoSeries."No. Series Line" |
The No. Series Line to set filters on. |
Remarks
Changing the filter on the "Series Code" field is not allowed and will result in an error.