<< Click to Display Table of Contents >> Navigation: Zetadocs SDK Guide > Zetadocs SDK API > OnBeforeArchive |
OnBeforeArchive Event
Runs before 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 OnBeforeArchive(var onBeforeArchiveHandler: Codeunit "Zetadocs OnBeforeArchive")
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", 'OnBeforeArchive', '', true, true)]
procedure OnBeforeArchive(var onBeforeArchiveHandler: Codeunit "Zetadocs OnBeforeArchive")
Zetadocs OnBeforeArchive 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 |
---|---|
GetSharePointSite(var Text) |
Gets the SharePoint site URL that the document will be archived to. |
SetSharePointSite(Text) |
Sets the SharePoint site URL that the document will be archived to. |
GetTargetLibrary(var Text) |
Gets the library name that the document will be archived to. |
SetTargetLibrary(Text) |
Sets the library name that the document will be archived to. |
GetSubFolders(var Text) |
Gets the sub folders path that the document will be archived to. e.g. "Contoso/Sales/" |
SetSubFolders(Text) |
Sets the sub folders path that the document will be archived to. |
GetFileName(var Text) |
Gets the file name that the document will be archived as. |
SetFileName(Text) |
Sets the file name that the document will be archived as. |
GetAdditionalMetadata(var Dictionary of [Text, Text]) |
Gets the dictionary of key value pairs that will be applied to the document template. |
AddOrUpdateMetadata(Text, Date) |
Adds or updates the template value for the specified key. |
AddOrUpdateMetadata(Text, Text) |
Adds or updates the template value for the specified key. |
GetRecordId(var RecordId) |
Gets the Business Central Record Id for the record that the document is being archived to. |
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", var RecordId, Codeunit "Zetadocs Upload Metadata", Codeunit "Zetadocs Upload Data") |
This method is called internally by the publisher, a call to this method will return an error. |
Will return the URL of the SharePoint Site that the document will be archived to.
Syntax
OnBeforeArchiveHandler.GetSharePointSite(var sharePointSite: Text);
Parameters
sharePointSite
Type: Text
The output variable for the SharePoint Site URL that the document will be archived to e.g. "https://example.SharePoint.com/sites/yoursitecollection".
Sets the SharePoint Site URL that the document will be archived to.
Syntax
OnBeforeArchiveHandler.SetSharePointSite(sharePointSite: Text);
Parameters
sharePointSite
Type: Text
The SharePoint Site URL for where the document will be archived e.g. "https://example.SharePoint.com/sites/yoursitecollection".
Will return the name of the document library that the document will be archived to in SharePoint Online.
Syntax
OnBeforeArchiveHandler.GetTargetLibrary(var targetLibrary: Text);
Parameters
targetLibrary
Type: Text
The output variable for the Target Library of the document e.g. "Zetadocs".
Sets the document library that the document will be archived to in SharePoint Online.
Syntax
OnBeforeArchiveHandler.SetTargetLibrary(targetLibrary: Text);
Parameters
targetLibrary
Type: Text
The target library for where the document will be archived in SharePoint Online e.g. "Zetadocs".
Will return the folder path that the document will be archived to in SharePoint Online.
Syntax
OnBeforeArchiveHandler.GetSubFolders(var subFolders: Text);
Parameters
subFolders
Type: Text
The output variable for the folder path of the document e.g. "Contoso/Sales".
Sets the folder path for where the document will be archived to in SharePoint Online.
Syntax
OnBeforeArchiveHandler.SetSubFolders(subFolders: Text);
Parameters
subFolders
Type: Text
The sub folder path for where the document will be archived in SharePoint Online e.g. "Contoso/Sales".
Will return the file name that the document will be archived as in SharePoint Online.
Syntax
OnBeforeArchiveHandler.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".
Sets the file name that the document will be archived as in SharePoint Online.
Syntax
OnBeforeArchiveHandler.SetFileName(fileName: Text);
Parameters
fileName
Type: Text
The file name of that the document will be archived as e.g. "Sales-Order 1001.pdf".
Will return the dictionary of key value pairs that will be archived as metadata to the document.
Syntax
OnBeforeArchiveHandler.GetAdditionalMetadata(var metadata: Dictionary of [Text, Text]);
Parameters
metadata
Type: Dictionary of [Text, Text]
The output variable for the dictionary of metadata key value pairs.
Adds or updates the metadata value (Text type) for the specified key.
Syntax
OnBeforeArchiveHandler.AddOrUpdateMetadata(keyName: Text, value: Text);
Parameters
keyName
Type: Text
The key that will be changed, it must match the column name in SharePoint Online.
value
Type: Text
The value that will stored in SharePoint Online.
Adds or updates the metdata value (Date type) for the specified key.
Syntax
OnBeforeArchiveHandler.AddOrUpdateMetadata(keyName: Text, value: Date);
Parameters
keyName
Type: Text
The key that will be changed, it must match the column name in SharePoint Online.
value
Type: Date
The value that will stored in SharePoint Online.
Gets the Business Central Record Id for the record that is being archived.
Syntax
OnBeforeArchiveHandler. GetRecordId(var theRecordId: RecordId);
Parameters
theRecordId
Type: RecordId
The output variable for the record Id of the document that is being archived.
This method should be used to push errors that have been raised by Zetadocs Capture and Zetadocs Delivery to declare stop the process execution.
Syntax
OnBeforeArchiveHandler.PropagateLastError();
This method is used to pass any custom errors to Zetadocs.
Syntax
OnBeforeArchiveHandler.SetError(errorText: Text);
Parameters
Type: Text
The error message to pass to Zetadocs.
Initialises the OnBeforArchive object with the relevant information. This will be done internally and is not for 3rd parties consumption.