<< Click to Display Table of Contents >> Navigation: Zetadocs SDK Guide > Zetadocs SDK API > OnAfterZetadocsDelivery |
OnAfterZetadocsDelivery Event
Runs after the whole Delivery and/or Archiving process has been completed. It provides methods to access the individual "Delivery Results" for each document being sent.
Publisher
[IntegrationEvent(false, false)]
procedure OnAfterZetadocsDelivery(var ZdOnAfterZetadocsDeliveryHandler: Codeunit "Zetadocs OnAfterZetadocsDelivery")
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", 'OnAfterZetadocsDelivery', '', false, false)]
procedure OnAfterZetadocsDelivery(var OnAfterZetadocsDeliveryHandler: Codeunit "Zdd OnAfterZetadocsDelivery")
begin
end;
Zetadocs OnAfterZetadocsDelivery codeunit
This codeunit exposes procedures that give you access to the delivery results, this represents the delivery of each document being sent, including the error message, to whom it was sent and the delivery method.
Method name |
Description |
---|---|
This method returns a boolean depending on whether the whole Zetadocs process was successful or not. |
|
This method returns a generic message outlining the total documents being sent and number in error. |
|
GetDeliveryResults(var JsonArray) |
This method returns an Array of "Delivery Results", this can be iterated over to retrieve information about each delivery. |
This method returns the User Id of the person sending the documents. |
|
GetEmailTo(var JsonObject) |
Get the EmailTo value for a particular "Delivery Result" |
GetEmailCc(var JsonObject) |
Get the EmailCc value for a particular "Delivery Result" |
GetEmailBCc(var JsonObject) |
Get the EmailBcc value for a particular "Delivery Result" |
IsArchivingEnabled(var JsonObject) |
This method returns a boolean representing the Archiving value in the "Zetadocs General Settings". |
GetArchiveLocation(var JsonObject) |
This method returns a text outlining the Archiving location of the document if it is enabled. |
IsArchiveSuccessful(var JsonObject) |
This method returns a true/false depending on whether the document was successfully Archived. |
GetRecordId(var JsonObject; var RecordId) |
Gets the RecordId attached to this Delivery. |
IsDeliverySuccessful(var JsonObject) |
This method returns a boolean representing if the Delivery part of the process has been a success (i.e. Hard Copy or Emailing). |
GetDeliveryErrorDescription(var JsonObject) |
Gets the Error Description text for this particular Delivery Result. |
IsDeliveryInError(var JsonObject) |
This method returns a boolean if this particular Delivery Result process has encountered an error at some stage. |
GetDeliveryMethod(var JsonObject) |
This method returns a text value representing how the Delivery was attempted, i.e. Hard Copy or Email. |
Gets the Name of the Report being Delivered |
|
Gets the DateTime value of when the Report was submitted |
|
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"; Boolean; Record "Zetadocs Send Batch") |
This method is called internally by the publisher, a call to this method will return an error. |
IsZetadocsDeliverySuccessful Method
This method returns a boolean depending on whether the whole Zetadocs Batch was successful or not.
Syntax
If (OnAfterZetadocsDelivery.IsZetadocsDeliverySuccessful()) then…
GetDeliveryErrorMessage Method
This method returns a message outlining the total documents being sent and the number in error.
Syntax
OnAfterZetadocsDeliveryHandler.GetDeliveryErrorMessage()
This method returns an Array of "Delivery Results", this can be iterated over to retrieve information about each delivery, the "Delivery Result" for a document. This JsonArray contains all the individual delivery and arhive data from the Zetadocs Batch being delivered. For example three documents are being processed, this method will return an array with three JsonTokens that should be converted to JsonObjects.
Syntax
OnAfterZetadocsDeliveryHandler.GetDeliveryResults(deliveryResults);
Parameters
deliveryResults
Type: JsonArray
This JsonArray can be iterated through to retrieve all the Delivery and Archive information from the Zetadocs Batch.
This method returns the User Id of the person sending the documents.
Syntax
SendingUser := OnAfterZetadocsDeliveryHandler.GetSendingUser();
Get the EmailTo value for a particular "Delivery Result". This this in conjunction with the GetDeliveryResults method to retrieve the Email values.
Syntax
EmailTo := OnAfterZetadocsDeliveryHandler.GetEmailTo(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
Get the EmailCc value for a particular "Delivery Result". This this in conjunction with the GetDeliveryResults method to retrieve the Email values.
Syntax
EmailCc := OnAfterZetadocsDeliveryHandler.GetEmailCc(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
Get the EmailBcc value for a particular "Delivery Result". This this in conjunction with the GetDeliveryResults method to retrieve the Email values.
Syntax
EmailBcc := OnAfterZetadocsDeliveryHandler.GetEmailBcc(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
This method returns a boolean representing if this Delivery Result has been enabled for Archiving. This should reflect the value from the "Zetadocs General Settings", note this could be overridden by the "Zetadocs System Rules".
Syntax
IsArchivingEnabled := OnAfterZetadocsDeliveryHandler.IsArchivingEnabled();
This method returns a text outlining the Archiving location of the document if it is enabled.
Syntax
ArchiveLocation := OnAfterZetadocsDeliveryHandler.GetArchiveLocation(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
This method returns a true/false depending on whether the document was successfully Archived.
Syntax
IsArchiveSuccess := OnAfterZetadocsDeliveryHandler.IsArchiveSuccessful(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
This method returns the RecordId associated with the document being delivered, this can be used to modify the record table.
Syntax
OnAfterZetadocsDeliveryHandler.GetRecordId(DeliveryResultObject, recordId);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
recordId
Type: RecordId
The document RecordId bein delivered. Can be used as the key to Get a record.
This method returns a boolean representing if the Delivery part of the process has been a success (i.e. Hard Copy or Emailing of documents).
Syntax
IsDeliverySuccess := OnAfterZetadocsDeliveryHandler.IsDeliverySuccessful(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
GetDeliveryErrorDescription Method
Gets the Error Description text for this particular Delivery Result. Each result could have a different error or no error if it has been succesfully processed, use this method to retrieve the value. Note that this is different to the GetDeliveryErrorMessage method that returns a message for the whole batch.
Syntax
ErrorDescription := OnAfterZetadocsDeliveryHandler.GetDeliveryErrorDescription(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
This method returns a boolean if this particular Delivery Result process has encountered an error at some stage.
Syntax
InError := OnAfterZetadocsDeliveryHandler.IsDeliveryInError(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
This method returns a text value representing how the Delivery was attempted, i.e. Hard Copy or Email.
Syntax
ErrorDescription := OnAfterZetadocsDeliveryHandler.GetDeliveryMethod(deliveryResult);
Parameters
deliveryResult
Type: JsonObject
Iterate through the GetDeliveryResults method output and pass the JsonObject into this method.
This method returns a text value representing the name of the Report that was submitted for Delivery. This is the same name as displayed in the Zetadocs Outbox.
Syntax
ErrorDescription := OnAfterZetadocsDeliveryHandler.GetReportName();
This method returns a DateTime data type for when the Report was submitted for Delivery.
Syntax
ErrorDescription := OnAfterZetadocsDeliveryHandler.GetReportDateTime();
This method is used to pass any custom errors to Zetadocs.
Syntax
OnAfterZetadocsDelivery.SetError(errorText: Text);
Parameters
errorText
Type: Text
The error message to pass to Zetadocs.
Initialises the OnAfterZetadocsDelivery object with the relevant information. This will be done internally and is not for 3rd parties consumption.