Interface "Retention Period"
The retention period interface provides functions to retrieve the date formula and calculate the expiration date based on a retention period record.
Methods
RetentionPeriodDateFormula
Returns the date formula for a given retention period.
procedure RetentionPeriodDateFormula(RetentionPeriod: Record "Retention Period"): Text
Parameters
| Name | Type | Description |
|---|---|---|
| RetentionPeriod | Table System.DataAdministration."Retention Period" |
The record that has the retention period for which you want the date formula. |
Returns
| Type | Description |
|---|---|
| Text |
The date formula as a string in a language-independent format. |
RetentionPeriodDateFormula
Returns the date formula for a given retention period.
procedure RetentionPeriodDateFormula(RetentionPeriod: Record "Retention Period", Translated: Boolean): Text
Parameters
| Name | Type | Description |
|---|---|---|
| RetentionPeriod | Table System.DataAdministration."Retention Period" |
The record that has the retention period for which you want the date formula. |
| Translated | Boolean |
Indicates whether to return the date formula in a language-independent format or in the current language format. |
Returns
| Type | Description |
|---|---|
| Text |
The date formula as a string. |
CalculateExpirationDate
Returns the expiration date for a given retention period.
procedure CalculateExpirationDate(RetentionPeriod: Record "Retention Period"): Date
Parameters
| Name | Type | Description |
|---|---|---|
| RetentionPeriod | Table System.DataAdministration."Retention Period" |
The record that has the retention period for which you want the expiration date. By default, the current date is used. |
Returns
| Type | Description |
|---|---|
| Date |
The expiration date. |
CalculateExpirationDate
Returns the expiration date for a given retention period.
procedure CalculateExpirationDate(RetentionPeriod: Record "Retention Period", UseDate: Date): Date
Parameters
| Name | Type | Description |
|---|---|---|
| RetentionPeriod | Table System.DataAdministration."Retention Period" |
The record that has the retention period for which you want the expiration date. |
| UseDate | Date |
The expiration date is calculated based on this date. |
Returns
| Type | Description |
|---|---|
| Date |
The expiration date. |
CalculateExpirationDate
Returns the expiration date and time for a given retention period.
procedure CalculateExpirationDate(RetentionPeriod: Record "Retention Period", UseDateTime: DateTime): DateTime
Parameters
| Name | Type | Description |
|---|---|---|
| RetentionPeriod | Table System.DataAdministration."Retention Period" |
The record that has the retention period for which you want the expiration date and time. |
| UseDateTime | DateTime |
The expiration date and time are calculated based on this date and time. |
Returns
| Type | Description |
|---|---|
| DateTime |
The expiration date and time. |