Customizing storage
Expense Management provides support for three different storage models: File System, Database, and Azure Blob Storage. But it's also possible for you to customize your storage by extending or overruling the way documents are stored and fetched in Expense Management.
Important
Various routines can invoke the following procedures in Expense Management. Document import is one such routine, there must be zero errors in the executing code, as that would break or stop the existing functionality.
You can overrule or extend the existing behavior using four different publisher events that are provided in the codeunit CEM Doc. File Events:
- SetAttachment — invoked when a file is requested to be stored.
- GetAttachment — invoked when a file is requested.
- HasAttachment — invoked when the existence of a file is checked.
- ClearAttachment — invoked when a file deletion is requested, for example when a document related to the relevant file is deleted or imported.
PDF documents are split into pages that are displayed in the addin. You can interact with the images by using the following events:
- SetPage — invoked when a file is requested to be stored.
- GetPage — invoked when a file is requested.
- HasPage — invoked when the existence of a file is checked.
- ClearPage — invoked when a file deletion is requested, for example when a document related to the relevant file is deleted or imported.
In several localizations, document signing is a necessity. In these cases, the following events can be used for interaction with digitally-signed PDF documents:
- SetPDF — invoked when a file is requested to be stored.
- GetPDF — invoked when a file is requested.
- HasPDF — invoked when the existence of a file is checked.
- ClearPDF — invoked when a file deletion is requested, for example when a document related to the relevant file is deleted or imported.
In Expense Management, all files are initially downloaded from Continia Online in a buffer called Attachment Inbox. This is why all events are also available for inbox processes as well. These are:
- SetInboxAttachment — invoked when a file is requested to be stored.
- GetInboxAttachment — invoked when a file is requested.
- HasInboxAttachment — invoked when the existence of a file is checked.
- ClearInboxAttachment — invoked when a file deletion is requested, for example when a document related to the relevant file is deleted or imported.
- SetInboxPage — invoked when a PDF page is requested to be stored.
- GetInboxPage — invoked when a PDF page is requested.
- HasInboxPage — invoked when the existence of a PDF page is checked.
- ClearInboxPage — invoked when a PDF page deletion is requested, for example when a document related to the relevant file is deleted or imported.
- SetInboxPDF