The FORNAV Customizable Report Pack comes with a built-in archiving feature. This feature automatically archives any FORNAV report that was used, and stores the output and metadata in the FORNAV Archive.
Some FORNAV users don’t want to store these archived documents in the Business Central database but would rather use an external database like the Azure Blob Storage, SharePoint, OneDrive, DropBox, or any other third-party document storage.
To enable this, we have created an event in codeunit 6189104 “ForNAV Document Archive Mgt.” that you can use to override the default archiving.
The event is called OnBeforeWriteToArchiveInternal and has the following signature:
- ReportID: Integer. The report ID.
- ReportAction: Option SaveAsPdf, SaveAsWord, SaveAsExcel, Preview, Print, SaveAsHtml . The report action that the user has chosen.
- Copies: Integer. The number of copies that the user has generated.
- var archiveKeyWords: Text. Contains metadata about the document.
- is: InStream. The document as a stream. Depending on the report action, this could be a PDF, docx, xlsx, or html file.
- var IsHandled: Boolean. If set to true, the standard FORNAV archiving code will not run and FORNAV will not archive the document.