Skip to content

KVSDMSEDocumentArchivingMgt#

Events#

OnBeforeAutoArchiveEDocument(Record E-Document Log, Boolean) :#

Summary: Event raised before processing Auto Archive of electronic Document.

[IntegrationEvent(false, false)]
local procedure OnBeforeAutoArchiveEDocument(var Rec: Record "E-Document Log"; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSDMSEDocumentArchivingMgt", 'OnBeforeAutoArchiveEDocument', '', false, false)]
local procedure DoSomethingOnBeforeAutoArchiveEDocument(var Rec: Record "E-Document Log"; var IsHandled: Boolean)
begin
end;

Parameters:

  • Rec: E-Document Log Entry that is inserted and will be processed for archiving incoming or outgoing electronic document.
  • IsHandled: Boolean that indicates if the event has been handled

Remarks: This event can be used to implement custom pre-processing logic or to skip certain E-Document Log entries from being automatically archived. If the event is handled and IsHandled is set to true, the automatic archiving process for the given E-Document Log entry will be skipped. This can be useful in scenarios where specific conditions need to be met before an electronic document is archived, or when certain documents should not be archived automatically. Please recognize, that the given E-Document Log may not include a document storage entry or an assigned document yet, e.g. when the log entry is created during document import before the document is assigned to a record.

OnAfterCalcFilenameForAutoArchiveEDocument(Record E-Document, Record E-Doc. Data Storage, Text) :#

Summary: Event raised after calculating the filename for automatic archiving of an electronic document.

[IntegrationEvent(false, false)]
local procedure OnAfterCalcFilenameForAutoArchiveEDocument(EDocument: Record "E-Document"; EDocDataStorage: Record "E-Doc. Data Storage"; var ResultFilename: Text): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSDMSEDocumentArchivingMgt", 'OnAfterCalcFilenameForAutoArchiveEDocument', '', false, false)]
local procedure DoSomethingOnAfterCalcFilenameForAutoArchiveEDocument(EDocument: Record "E-Document"; EDocDataStorage: Record "E-Doc. Data Storage"; var ResultFilename: Text)
begin
end;

Parameters:

  • EDocument: E-Document record describing the underlying record.
  • EDocDataStorage: E-Doc. Data Storage that is assigned to the E-Document and contains the Blob-Data with the file content.
  • ResultFilename: Text Vaule that contains the calculated filename as result and will be used to archive the according file.

Remarks: This event can be used to modify the calculated filename for automatic archiving of an electronic document. The default filename is sequently calculated based on: - the E-Doc. Data Storage Name - the E-Document File Name - a default pattern 'E-Document_(Entry No.).(File Extension)'. Custom logic can be implemented to change the ResultFilename parameter as needed.