Table of Contents

KVSDMSReportArchivingMgt

Summary: Codeunit for managing report archiving functionality in DMS/ECM integration.

Events

OnBeforeAutoArchiveReportByUserInteraction(Integer, JsonObject, InStream, Boolean, Boolean) :

Summary: Event raised before auto-archiving a report created through user interaction.

[IntegrationEvent(false, false)]
local procedure OnBeforeAutoArchiveReportByUserInteraction(ReportId: Integer; var ObjectPayload: JsonObject; var DocumentStream: InStream; IsDownload: Boolean; var IsHandled: Boolean): 

Parameters:

  • ReportId: ID of the report being processed.
  • ObjectPayload: Payload containing report metadata from report management.
  • DocumentStream: Generated report content stream.
  • IsDownload: Specifies whether the report action was a download/print operation.
  • IsHandled: Set to true to fully handle the process and skip standard logic.

Remarks: Use this event to override or extend the standard report auto-archiving flow for interactive report output.

OnBeforeUploadFileAutoArchiveReportByUserInteraction(Integer, JsonObject, InStream, Record KVSDMSAutoReportArchiving, Record KVSDMSStorageDefinition, Record KVSDMSDocumentDrive, Text, Text) :

Summary: Event raised before uploading a file for auto-archiving of a user-triggered report.

[IntegrationEvent(false, false)]
local procedure OnBeforeUploadFileAutoArchiveReportByUserInteraction(ReportId: Integer; ObjectPayload: JsonObject; DocumentStream: InStream; AutoReportArchiving: Record "KVSDMSAutoReportArchiving"; StorageDefinition: Record "KVSDMSStorageDefinition"; var DocumentDrive: Record "KVSDMSDocumentDrive"; var DirectoryPath: Text; var FileName: Text): 

Parameters:

  • ReportId: ID of the report being archived.
  • ObjectPayload: Payload containing report metadata from report management.
  • DocumentStream: Generated report content stream to upload.
  • AutoReportArchiving: Matching auto report archiving setup record.
  • StorageDefinition: Resolved storage definition used for upload.
  • DocumentDrive: Document Drive record that will be created or updated.
  • DirectoryPath: Resolved directory path for the uploaded file.
  • FileName: File name used for the uploaded report file.

Remarks: Use this event to adjust naming, target location, or metadata before the file is uploaded.

OnBeforeAutoArchiveReportByPosting(Variant, Enum Report Selection Usage, Boolean) :

[IntegrationEvent(false, false)]
local procedure OnBeforeAutoArchiveReportByPosting(RecVariant: Variant; ReportUsage: Enum "Report Selection Usage"; var IsHandled: Boolean): 

OnEnqueueRunAndUploadAutoReportArchivingInJobQueue(Variant, Record KVSDMSAutoReportArchiving, Record Job Queue Entry) :

Summary: Event raised when a job queue entry is prepared for asynchronous auto report archiving.

[IntegrationEvent(false, false)]
local procedure OnEnqueueRunAndUploadAutoReportArchivingInJobQueue(RecVariant: Variant; AutoReportArchiving: Record "KVSDMSAutoReportArchiving"; var JobQueueEntry: Record "Job Queue Entry"): 

Parameters:

  • RecVariant: Source record variant used for archiving.
  • AutoReportArchiving: Auto report archiving setup used for enqueueing.
  • JobQueueEntry: Job queue entry that will run the upload process.

Remarks: Use this event to enrich or modify the queued job before it is scheduled.

OnBeforeGetRootTableIdFromReport(Integer, Integer, Boolean, Boolean) :

Summary: Event raised before resolving the root table from a report definition.

[IntegrationEvent(false, false)]
local procedure OnBeforeGetRootTableIdFromReport(ReportId: Integer; var TableId: Integer; var Result: Boolean; var IsHandled: Boolean): 

Parameters:

  • ReportId: ID of the report for which the root table is requested.
  • TableId: Resolved root table ID.
  • Result: Set to true when a valid result is provided.
  • IsHandled: Set to true to bypass standard root-table resolution.

Remarks: Use this event to provide custom root-table resolution for specific reports.

OnBeforeGetSourceRecordFromPayloadData(JsonObject, Integer, RecordRef, Boolean, Boolean) :

Summary: Event raised before deriving the source record from payload data.

[IntegrationEvent(false, false)]
local procedure OnBeforeGetSourceRecordFromPayloadData(ObjectPayload: JsonObject; TableID: Integer; var RecRef: RecordRef; var Result: Boolean; var IsHandled: Boolean): 

Parameters:

  • ObjectPayload: Payload with source information.
  • TableID: Expected table ID for the source record.
  • RecRef: RecordRef that can be initialized by subscribers.
  • Result: Set to true when source record resolution succeeded.
  • IsHandled: Set to true to skip standard payload parsing logic.

Remarks: Use this event to customize source record lookup when report payload structure differs.

OnAfterSetFilterIsAutoPrintInBackgroundEnabled(Integer, Record Report Selections) :

Summary: Event raised after filtering report selections for auto-print-in-background checks.

[IntegrationEvent(false, false)]
local procedure OnAfterSetFilterIsAutoPrintInBackgroundEnabled(ReportID: Integer; var ReportSelection: Record "Report Selections"): 

Parameters:

  • ReportID: Report ID used for filtering report selections.
  • ReportSelection: Filtered report selections record.

Remarks: Use this event to apply additional filtering or diagnostics for report selection processing.

OnBeforeUpdateIsAutoPrintInBackgroundEnabled(Record Report Selections, Boolean) :

Summary: Event raised before updating the auto-print-in-background flag on a report selection.

[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateIsAutoPrintInBackgroundEnabled(var ReportSelection: Record "Report Selections"; var IsHandled: Boolean): 

Parameters:

  • ReportSelection: Report selection record that is about to be updated.
  • IsHandled: Set to true to prevent standard update behavior.

Remarks: Use this event to override the decision logic for background auto-print updates.