|
<< Click to Display Table of Contents >> Navigation: Zetadocs SDK Guide > Zetadocs SDK API > OnAfterArchive |
OnAfterArchive Event
Runs after archiving documents to SharePoint Online with Zetadocs, includes archiving on Zetadocs send; archiving with the Factbox and archiving from a Documents Queue.
Publisher
[IntegrationEvent(false, false)]
procedure OnAfterArchive(var onAfterArchiveHandler: Codeunit "Zdd OnAfterArchive")
begin
end;
Subscriber
To subscribe to this event, you will need to decorate the subscriber method with the correct EventSubscriber attributes:
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Zetadocs Customize", 'OnAfterArchive', '', true, true)]
procedure OnAfterArchive(var onAfterArchiveHandler: Codeunit "Zdd OnAfterArchive")
Zetadocs OnAfterArchive Codeunit
This codeunit exposes procedures that allow you to add or update metadata values that will be archived to SharePoint Online as well as customize the location in SharePoint that the document will be archived.
Method name |
Description |
|---|---|
GetArchiveFileName(var Text) |
Gets the file name that the document was archived as. |
GetArchiveFileUrl(var Text) |
Gets the SharePoint URL that the document was archived to. |
GetRecordId(var RecordId) |
Gets the Business Central Record Id for the record that the document was archived to. |
GetSuccessStatus(var Bool, var Text) |
Gets the result of the archive operation and the error message in case of an error. |
This method will propagate any errors raised in the event subscriber back to Zetadocs Capture and Delivery. |
|
SetError(Text) |
This method can be used to send a custom error message to Zetadocs Capture and Delivery. |
Init(Codeunit "Zetadocs Operation Context", var Codeunit "Zetadocs Customize", RecordId, Text, Boolean, Text) |
This method is called internally by the publisher, a call to this method will return an error. |
Will return the file name that the document was archived as in SharePoint Online.
Syntax
OnAfterArchiveHandler.GetFileName(var fileName: Text);
Parameters
fileName
Type: Text
The output variable for the file name of that the document e.g. "Sales-Order 1001.pdf".
Will return the file name that the document was archived as in SharePoint Online.
Syntax
OnAfterArchiveHandler.GetFileName(var fileUrl: Text);
Parameters
fileUrl
Type: Text
The output variable for the URL of that the document e.g. "https://example.sharepoint.com/Site/Zetadocs/Customers/invoice.pdf".
Gets the Business Central Record Id for the record that was archived to.
Syntax
OnAfterArchiveHandler. GetRecordId(var theRecordId: RecordId);
Parameters
theRecordId
Type: RecordId
The output variable for the record Id of the document that was archived.
Gets the success result of the archive the Businss Central Record and the errorMessage if there was an error, otherwise it's an empty Text.
Syntax
OnAfterArchiveHandler. GetSuccessStatus(var isSuccess: Boolean, var errorMessage: Text);
Parameters
isSuccess
Type: Boolean
The output variable for the record Id of the document that was archived.
errorMessage
Type: Text
The output variable for the errorMessage in case of a failed archive.
This method is used to pass any custom errors to Zetadocs.
Syntax
OnAfterArchiveHandler.SetError(errorText: Text);
Parameters
Type: Text
The error message to pass to Zetadocs.
Initialises the OnAfterArchive object with the relevant information. This will be done internally and is not for 3rd parties consumption.