<< Click to Display Table of Contents >> Navigation: Zetadocs SDK Guide > Zetadocs SDK API > OnAfterGenerateCaptureResults |
OnAfterGenerateCaptureResults Event
Runs after generating the record to associate the documents in the Document Queue, after archiving the document against the record, and before posting or deleting from the Document Queue.
Publisher
[IntegrationEvent(false, false)]
procedure OnAfterGenerateCaptureResults(var onAfterGenerateCaptureResultsHandler: Codeunit "Zdd OnAfterGenerateCaptureRes")
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", 'OnAfterGenerateCaptureResults', '', true, true)]
local procedure OnAfterGenerateCaptureResults(var onAfterGenerateCaptureResultsHandler: Codeunit "Zdd OnAfterGenerateCaptureRes")
Zdd OnAfterGenerateCaptureRes codeunit
This codeunit exposes procedures that allow you to consolidate the records generated in regard to the document in the Zetadocs Document Queue.
Method name |
Description |
---|---|
GetDocumentBarcodes(var List of [Text]) |
Will return the list of Barcodes referenced in a document. |
GetDocumentId(): Text |
Will return the name, or Document Id, of the document in the Document Queue. |
GetDocumentQueueSettings(Record "Zetadocs Document Queue") |
Will return the settings of the Document Queue being processed. |
GetGeneratedRecordId(var RecordId) |
Gets the Business Central record that is being linked to a document in the Document Queue. |
GetInvoiceTax(): Decimal |
Will return the Tax amount extracted from the Document in the Document Queue. |
GetShippingAddressInput(): Text |
Will return the shipping address extracted from the Document in the Document Queue. |
GetRecognisedKeyValuePairs(): JsonArray |
Will return a JsonArray of all the recognised Key Value pairs from the document in the Document Queue. |
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(var documentBarcodes: List of [Text]);
Parameters
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. GetDocumentId() documentId: Text;
Parameters
documentId
Type: Text
Returns the document id that is 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.GetGeneratedRecordId(var recId: RecordId)
Parameters
recId
Type: RecordId
The Business Central document that the above document Id is linked to.
Will return the Tax amount extracted from the Document in the Document Queue.
Syntax
onAfterGenerateCaptureResultsHandler.GetInvoiceTax() TaxAmount: Decimal
Parameters
TaxAmount
Type: Decimal
The tax amount recognised from the invoice header.
GetShippingAddressInput Method
Will return the shipping address extracted from the Document in the Document Queue.
Syntax
onAfterGenerateCaptureResultsHandler.GetShippingAddressInput() DeliveryAddress: Text
Parameters
DeliveryAddress
Type: Text
The Shipping address recognized in the document from the Document Queue.
GetRecognisedKeyValuePairs Method
Will return a JsonArray of all the recognised Key Value pairs from the document in the Document Queue.
Syntax
onAfterGenerateCaptureResultsHandler.GetRecognisedKeyValuePairs() KeyValuePairs : JsonArray
Parameters
KeyValuePairs
Type: JsonArray
The JSON array of the Key Value Pairs that have been recognised in the document. The JSON will be in the format:
'[
{"Key": "IBAN:", "Value": "GB23 BOFA 121211 4534333"},
{"Key": "Bank:", "Value": "HSBC Bank PLC."},
{"Key": "Sort code:", "Value": "111111."}
]'
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.