Interface "Reten. Pol. Filtering"
The Reten. Pol. Filtering interface is used to set filters on the table for which a retention policy is applied.
Methods
ApplyRetentionPolicyAllRecordFilters
This method is called when the retention policy applies to all records of the table. The FilterRecordRef must contain filters whe returned.
procedure ApplyRetentionPolicyAllRecordFilters(RetentionPolicySetup: Record "Retention Policy Setup", var FilterRecordRef: RecordRef, var RetenPolFilteringParam: Record "Reten. Pol. Filtering Param" temporary): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RetentionPolicySetup | Table System.DataAdministration."Retention Policy Setup" |
The retention policy for which filters are applied. |
| FilterRecordRef | RecordRef |
A RecordRef of the table on which the filters are applied. |
| RetenPolFilteringParam | Table System.DataAdministration."Reten. Pol. Filtering Param" |
The parameter table for this run of apply retention policy. |
Returns
| Type | Description |
|---|---|
| Boolean |
Returns true when there are expired records in the filters |
ApplyRetentionPolicySubSetFilters
This method is called when the retention policy defines subsets of records. The records in FilterRecordRef must be marked to indicate they are part of the union of all subsets.
procedure ApplyRetentionPolicySubSetFilters(RetentionPolicySetup: Record "Retention Policy Setup", var FilterRecordRef: RecordRef, var RetenPolFilteringParam: Record "Reten. Pol. Filtering Param" temporary): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RetentionPolicySetup | Table System.DataAdministration."Retention Policy Setup" |
The retention policy for which filters are applied. |
| FilterRecordRef | RecordRef |
A RecordRef of the table on which the filters are applied. |
| RetenPolFilteringParam | Table System.DataAdministration."Reten. Pol. Filtering Param" |
The parameter table for this run of apply retention policy. |
Returns
| Type | Description |
|---|---|
| Boolean |
Returns true when there are expired records in the filters |
HasReadPermission
This method is used to determine whether the implementation has read permission to the table specified in TableId. The permissions depend on both the user and the implementation codeunit. If the combination of user and implementation codeunit do not have read permission to the table, the retention policy will not be applied. A notification will be shown on the Retention Policy Setup card.
procedure HasReadPermission(TableId: Integer): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| TableId | Integer |
The ID of the table for a retention policy is defined |
Returns
| Type | Description |
|---|---|
| Boolean |
Returns true if the records in the table can be read. |
Examples
procedure HasReadPermission(TableId: Integer): Boolean var RecRef: RecordRef; begin RecRef.Open(TableId); exit(RecRef.ReadPermission()) end;
Count
This method is to count the records in the table specified in the RecRef. The method is only called when the base code does not have read permission to the table.
procedure Count(RecordRef: RecordRef): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
A record reference. |
Returns
| Type | Description |
|---|---|
| Integer |
The number of records. |
Examples
procedure Count(RecRef:RecordRef): Integer begin exit(RecRef.Count()) end;