Codeunit "Data Archive"
Exposes functionality to archive / save data before deleting it.
Properties
| Name | Value |
|---|---|
| Access | Public |
| InherentEntitlements | X |
| InherentPermissions | X |
Methods
Create
Creates a new archive entry.
procedure Create(Description: Text): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| Description | Text |
The name or description for the archive entry. Will typically be the calling object name. |
Returns
| Type | Description |
|---|---|
| Integer |
The entry no. of the created archive entry - if any. |
CreateAndStartLoggingDeletions
Creates a new archive entry, resets the session and starts logging all new deletions.
procedure CreateAndStartLoggingDeletions(Description: Text): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| Description | Text |
The name or description for the archive entry. Will typically be the calling object name. |
Returns
| Type | Description |
|---|---|
| Integer |
The entry no. of the created archive entry - if any. |
Open
Opens an existing archive entry.
procedure Open(ID: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| ID | Integer |
The ID of the archive entry. |
Save
Saves and closes the currently open archive entry.
procedure Save()
DiscardChanges
Discards any additions and closes the currently open archive entry.
procedure DiscardChanges()
SaveRecord
Saves the supplied record to the currently open archive entry.
procedure SaveRecord(RecordVariant: Variant)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordVariant | Variant |
The record will be copied to the archive. |
SaveRecord
Saves the supplied record to the currently open archive entry.
procedure SaveRecord(var RecordRef: RecordRef)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
The record will be copied to the archive. |
SaveRecords
Saves all records within the filters to the currently open archive entry.
procedure SaveRecords(var RecordRef: RecordRef)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
StartSubscriptionToDelete
Starts subscription to the OnDatabaseDelete trigger and calls SaveRecord with any deleted record.
procedure StartSubscriptionToDelete()
StartSubscriptionToDelete
Starts subscription to the OnDatabaseDelete trigger and calls SaveRecord with any deleted record.
procedure StartSubscriptionToDelete(ResetSession: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ResetSession | Boolean |
StopSubscriptionToDelete
Stops the subscription to the OnDatabaseDelete trigger.
procedure StopSubscriptionToDelete()
DataArchiveProviderExists
Informs the consumer app whether there is a provider for this interface.
procedure DataArchiveProviderExists(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
Returns true if a provider for this interface is installed. |
SetDataArchiveProvider
Checks if there is an implementation of an IDataArchiveProvider
procedure SetDataArchiveProvider(var NewDataArchiveProvider: Interface "Data Archive Provider")
Parameters
| Name | Type | Description |
|---|---|---|
| NewDataArchiveProvider | Interface System.DataAdministration."Data Archive Provider" |
Events
OnDataArchiveImplementationExists
Checks if there is an implementation of an IDataArchiveProvider
[IntegrationEvent(False,False)]
internal procedure OnDataArchiveImplementationExists(var Exists: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| Exists | Boolean |
A subscriber should set the value to true if it is an implementation of IDataArchiveProvider. |
OnDataArchiveImplementationBind
Asks for an implementation of an IDataArchiveProvider
[IntegrationEvent(False,False)]
internal procedure OnDataArchiveImplementationBind(var IDataArchiveProvider: Interface "Data Archive Provider", var IsBound: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| IDataArchiveProvider | Interface System.DataAdministration."Data Archive Provider" | |
| IsBound | Boolean |
The first subscriber should set this parameter to true. If it was already true, the code should just exit immediately without binding a provider. |