<< Click to Display Table of Contents >> Navigation: Zetadocs SDK Guide > Zetadocs SDK API > OnAfterCapture |
OnAfterCapture Event
Runs after the whole Zetadocs Capture process has been completed. It provides methods to access the individual "Capture Results" for each document being processed.
Publisher
[IntegrationEvent(false, false)]
procedure OnAfterCapture(var onAfterCaptureHandler: Codeunit "Zdd OnAfterCapture")
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", 'OnAfterCapture', '', true, true)]
procedure OnAfterCapture(var onAfterCaptureHandler: Codeunit "Zdd OnAfterCapture")
begin
end;
Zdd OnAfterCapture codeunit
This codeunit exposes procedures that give you access to the Capture results, this represents the capture of each document being sent, including the error message.
Method name |
Description |
---|---|
GetDocumentBarcodes(Text; var List of [Text]) |
Will return the list of Barcodes referenced in the document specified. |
GetDocumentIds( List of [Text]): |
Will return the names, or Document Ids, of the documents proccessed in the Document Queue. |
GetDocumentQueueSettings(Record "Zetadocs Document Queue") |
Will return the settings of the Document Queue being processed. |
GetRecordId(Text; var RecordId) |
Gets the Business Central record that is being linked to a document in the Document Queue. |
GetShippingAddress(Text; var Text) |
Will return the shipping address extracted from the Document in the Document Queue. |
GetSuccessStatus(Text; var Boolean; var Text) |
Get the success status of the Capture process and the error message associated. |
SetError(Text) |
This method can be used to send a custom error message to Zetadocs Capture and Delivery. |
Init(...) |
This method is called internally by the publisher, a call to this method will return an error. |
Will return the list of Barcodes referenced in a document.
Syntax
onAfterGenerateCaptureResultsHandler.GetDocumentBarcodes(documentId: Text; var documentBarcodes: List of [Text])
Parameters
documentId
Type: Text
The document Id used to retrieve barcodes for.
documentBarcodes
Type: List of [Text]
Returns a list of barcodes associated with the document id passed into the function, these can be used to link to a document in Business Central.
Will return the name, or Document Id, of the document in the Document Queue.
Syntax
onAfterGenerateCaptureResultsHandler.GetDocumentIds(var documentIds: List of [Text])
Parameters
documentIds
Type: List of [Text]
Returns the document ids that are being processed by Zetadocs Capture.
GetDocumentQueueSettings Method
Will return the settings of the Document Queue being processed.
Syntax
onAfterGenerateCaptureResultsHandler. GetDocumentQueueSettings(var documentQueueTemporaryRecord: Record "Zetadocs Document Queue");
Parameters
documentQueueTemporaryRecord
Type: Record "Zetadocs Document Queue"
The record variable that will store a copy of the settings used. This variable is expected to be a temporary table.
Gets the Business Central record that is being linked to a document in the Document Queue.
Syntax
onAfterGenerateCaptureResultsHandler.GetRecordId(documentId: Text; var theRecordId: RecordId)
Parameters
documentId
Type: Text
The document Id used to retrieve RecordId for.
recId
Type: RecordId
The Business Central document that the above document Id is linked to.
Will return the shipping address extracted from the Document in the Document Queue.
Syntax
onAfterGenerateCaptureResultsHandler.GetShippingAddress(documentId: Text; var DeliveryAddress: Text)
Parameters
documentId
Type: Text
The document Id used to retrieve the DeliveryAddress for.
DeliveryAddress
Type: Text
The Shipping address recognized in the document from the Document Queue.
Will return the success status of the processing of the Document in the Document Queue, including the error message if relevant.
Syntax
onAfterGenerateCaptureResultsHandler.GetSuccessStatus(documentId: Text; var IsSuccess: Boolean; var errorMessage: Text)
Parameters
documentId
Type: Text
The document Id used to retrieve the success status and error message for.
IsSuccess
Type: Boolean
The process status. Indicates if the whole process of Zetadocs Capture for this document was successful. It does not cover if deleting the document after processing will be successful.
errorMessage
Type: Text
The error message associated with the processed document.
This method is used to pass any custom errors to Zetadocs.
Syntax
onAfterGenerateCaptureResultsHandler.SetError(errorText: Text);
Parameters
Type: Text
The error message to pass to Zetadocs.
Initialises the onAfterGenerateCaptureResultsHandler object with the relevant information. This will be done internally and is not for 3rd parties consumption.