Codeunit WSB_DMQEventPublishers
Exposes procedures that are invoked by the "Document Mail Queue" app and which triggers event publishers to which other extensions can subscribe to enhance/integrate with the functionality.
Properties
Methods
wgFncAddDocumentAttachmentsToEmailMessage
Adds all applicable attachments to the passed email message.
Parameters
Type |
Name |
Description |
Codeunit "Email Message" |
vCduEmailMessage |
The Email Message to add the attachments to. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage that applies |
Integer |
pDocumentTableID |
The document table ID. |
Code[20] |
pDocumentNo |
The document no. |
RecordRef |
vRecRefSourceDoc |
A recordref of the source document. |
Returns
Type |
Description |
Boolean |
true if attachments were added |
wgFncGetDocumentReportAttachment
Gets the document report attachment to use for emailing for a report selection usage.
Parameters
Type |
Name |
Description |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Code[10] |
pSequenceNo |
The report selection sequence no. to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
Integer |
pDocumentTableID |
The document table ID. |
Code[20] |
pDocumentNo |
The document no. |
RecordRef |
vRecRefSourceDoc |
The source document. |
Codeunit "Temp Blob" |
vCduTempBlob |
The Temp Blob to write the PDF to. |
Returns
Type |
Description |
Boolean |
true if the document report attachment was retrieved successfully. |
wgFncGetDocumentReportAttachment
Gets the document report attachment to use for emailing for a report selection usage for a queue entry.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
The queue entry no. |
Integer |
vReportID |
The ID of the report object to use for generating the attachment. |
Code[20] |
vCustomReportLayoutCode |
The code of the custom report layout to use for generating the attachment. |
Text[250] |
vReportLayoutName |
The name of the report layout to use for generating the attachment. |
Guid |
vReportLayoutAppID |
The corresponding app ID for the report layout to use for generating the attachment (only for extension-provided report layouts). |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Code[10] |
pSequenceNo |
The report selection sequence no. to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
Integer |
pDocumentTableID |
The document table ID. |
Code[20] |
pDocumentNo |
The document no. |
RecordRef |
vRecRefSourceDoc |
The source document. |
Codeunit "Temp Blob" |
vCduTempBlob |
The Temp Blob to write the PDF to. |
Returns
Type |
Description |
Boolean |
true if the document report attachment was retrieved successfully. |
wgFncGetEmailBody
Gets the email body to use for emailing for a queue entry.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
The queue entry no. |
Integer |
vEmailBodyReportID |
The ID of the report object to use for generating the email body. |
Code[20] |
vEmailBodyCustomReportLayoutCode |
The code of the custom report layout to use for generating the email body. |
Text[250] |
vEmailBodyLayoutName |
The name of the report layout to use for generating the email body. |
Guid |
vEmailBodyLayoutAppID |
The corresponding app ID for the report layout to use for generating the email body (only for extension-provided report layouts). |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
RecordRef |
vRecRefSourceDoc |
The source document. |
OutStream |
vOutStreamEmailBody |
The OutStream to write the HTML email body to. |
Returns
Type |
Description |
Boolean |
true if the email body was retrieved successfully. |
wgFncGetEmailBody
Gets the email body to use for emailing for a report selection usage.
Parameters
Type |
Name |
Description |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
RecordRef |
vRecRefSourceDoc |
The source document. |
OutStream |
vOutStreamEmailBody |
The OutStream to write the HTML email body to. |
Returns
Type |
Description |
Boolean |
true if the email body was retrieved successfully. |
wgFncGetSourceTableIDAndSourceNoForDocument
Gets the Source Table ID and Source No. for the passed Document record. This procedure is used in Document Mail Queue to get the appropriate (custom) report selection(s) to retrieve the report request page parameters to use.
Parameters
Type |
Name |
Description |
Variant |
pDocRecRelatedVariant |
The source document |
Integer |
vSourceTableID |
Source Table ID, e.g. Customer or Vendor table ID |
Code[20] |
vSourceNo |
The Source No., e.g., Customer No. or Vendor No. |
wgFncSendEmail
Sends an email message for a specified report selection.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
Entry No (PK) of the Document Mail Queue record |
Codeunit "Email Message" |
vCduEmailMessage |
The email message to send. |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage. |
Code[10] |
pSequenceNo |
The sequence no. of the report selection. |
Integer |
pSourceTableID |
The ID/number of the source entity table (customer/vendor). |
Code[20] |
pSourceNo |
The no. of the source entity (customer/vendor). |
Integer |
pDocumentTableID |
The ID/number of the document table. |
Code[20] |
pDocumentNo |
The number of the document. |
RecordRef |
vRecRefSourceDoc |
A recordref of the source entity. |
Codeunit "Temp Blob" |
vCduTempBlobReportAttachment |
A TempBlob containing the document report attachment that is sent with the e-mail message. |
Returns
Type |
Description |
Boolean |
true if sending the email was successful. |
wlEvpOnAddDocumentAttachmentsToEmailMessage
Allows to add document attachments to Document Mail Queue email messages.
Parameters
Type |
Name |
Description |
Codeunit "Email Message" |
vCduEmailMessage |
The Email Message to add the attachments to. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage that applies |
Integer |
pDocumentTableID |
The document table ID. |
Code[20] |
pDocumentNo |
The document no. |
RecordRef |
vRecRefSourceDoc |
A recordref of the source document. |
Boolean |
vAttachmentsAdded |
Specifies if attachments were added (by your subscriber or previous subscribers). |
wlEvpOnAfterGetDocumentReportAttachment
Allows to hook into the moment right after the document report attachment for the Document Mail Queue email message is retrieved.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
The queue entry no. |
Integer |
vReportID |
The ID of the report object to use for generating the attachment. |
Code[20] |
vCustomReportLayoutCode |
The code of the custom report layout to use for generating the attachment. |
Text[250] |
vReportLayoutName |
The name of the report layout to use for generating the attachment. |
Guid |
vReportLayoutAppID |
The corresponding app ID for the report layout to use for generating the attachment (only for extension-provided report layouts). |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Code[10] |
pSequenceNo |
The report selection sequence no. to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
Integer |
pDocumentTableID |
The document table ID. |
Code[20] |
pDocumentNo |
The document no. |
RecordRef |
vRecRefSourceDoc |
The source document. |
Codeunit "Temp Blob" |
vCduTempBlob |
The Temp Blob to write the PDF to. |
Boolean |
vSuccess |
Specifies whether retrieving the document report attachment was successful. |
wlEvpOnAfterGetSourceTableIDAndSourceNoForDocument
Allows to hook into the moment right after retrieving the table ID and source entity no. for a document.
Parameters
Type |
Name |
Description |
Variant |
pDocRecRelatedVariant |
The document record. |
Integer |
vSourceTableID |
The table ID of the source entity (customer/vendor). |
Code[20] |
vSourceNo |
The no. of the source entity (customer/vendor). |
wlEvpOnAfterSendEmail
Allows to hook into the moment right after a Document Mail Queue email message has been sent.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
Entry No (PK) of the Document Mail Queue record |
Codeunit "Email Message" |
vCduEmailMessage |
The email message to send. |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage. |
Code[10] |
pSequenceNo |
The sequence no. of the report selection. |
Integer |
pSourceTableID |
The ID/number of the source entity table (customer/vendor). |
Code[20] |
pSourceNo |
The no. of the source entity (customer/vendor). |
Integer |
pDocumentTableID |
The ID/number of the document table. |
Code[20] |
pDocumentNo |
The number of the document. |
RecordRef |
vRecRefSourceDoc |
A recordref of the source entity. |
Codeunit "Temp Blob" |
vCduTempBlobReportAttachment |
A TempBlob containing the document report attachment that is sent with the e-mail message. |
Boolean |
pEmailSent |
Specifies if sending the email was successful. |
wlEvpOnBeforeGetDocumentReportAttachment
Allows to hook into the moment right before the document report attachment for the Document Mail Queue email message is retrieved.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
The queue entry no. |
Integer |
vReportID |
The ID of the report object to use for generating the attachment. |
Code[20] |
vCustomReportLayoutCode |
The code of the custom report layout to use for generating the attachment. |
Text[250] |
vReportLayoutName |
The name of the report layout to use for generating the attachment. |
Guid |
vReportLayoutAppID |
The corresponding app ID for the report layout to use for generating the attachment (only for extension-provided report layouts). |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Code[10] |
pSequenceNo |
The report selection sequence no. to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
Integer |
pDocumentTableID |
The document table ID. |
Code[20] |
pDocumentNo |
The document no. |
RecordRef |
vRecRefSourceDoc |
The source document. |
Codeunit "Temp Blob" |
vCduTempBlob |
The Temp Blob to write the PDF to. |
Boolean |
vIsHandled |
Set this parameter to true if your extension handles retrieving the document report attachment. |
Boolean |
vSuccess |
Specifies whether retrieving the document report attachment was successful. |
wlEvpOnBeforeGetEmailBody
Allows to hook into the moment right before getting the email body to use for emailing for a queue entry.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
The queue entry no. |
Integer |
vEmailBodyReportID |
The ID of the report object to use for generating the email body. |
Code[20] |
vEmailBodyCustomReportLayoutCode |
The code of the custom report layout to use for generating the email body. |
Text[250] |
vEmailBodyLayoutName |
The name of the report layout to use for generating the email body. |
Guid |
vEmailBodyLayoutAppID |
The corresponding app ID for the report layout to use for generating the email body (only for extension-provided report layouts). |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
RecordRef |
vRecRefSourceDoc |
The source document. |
OutStream |
vOutStreamEmailBody |
The OutStream to write the HTML email body to. |
Boolean |
vIsHandled |
Set this parameter to true if your extension handles retrieving the email body for this case. |
Boolean |
vSuccess |
Specifies whether the email body was retrieved successfully. |
wlEvpOnBeforeGetSourceTableIDAndSourceNoForDocument
Allows to hook into the moment right before retrieving the table ID and source entity no. for a document.
Parameters
Type |
Name |
Description |
Variant |
pDocRecRelatedVariant |
The document record. |
Integer |
vSourceTableID |
The table ID of the source entity (customer/vendor). |
Code[20] |
vSourceNo |
The no. of the source entity (customer/vendor). |
Boolean |
vIsHandled |
Set this parameter to true if your extension handles retrieving the source entity table ID and no. for this document record. |
wlEvpOnBeforeSendEmail
Allows to hook into the moment right after a Document Mail Queue email message has been sent.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
Entry No (PK) of the Document Mail Queue record |
Codeunit "Email Message" |
vCduEmailMessage |
The email message to send. |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage. |
Code[10] |
pSequenceNo |
The sequence no. of the report selection. |
Integer |
pSourceTableID |
The ID/number of the source entity table (customer/vendor). |
Code[20] |
pSourceNo |
The no. of the source entity (customer/vendor). |
Integer |
pDocumentTableID |
The ID/number of the document table. |
Code[20] |
pDocumentNo |
The number of the document. |
RecordRef |
vRecRefSourceDoc |
A recordref of the source entity. |
Codeunit "Temp Blob" |
vCduTempBlobReportAttachment |
A TempBlob containing the document report attachment that is sent with the e-mail message. |
Boolean |
vIsHandled |
Set this parameter to true if your extension handles sending the email for this case. |
Boolean |
vEmailSent |
Specifies if sending the email was successful. |
wlEvpOnGetDocumentReportAttachment
Allows to implement retrieving the document report attachment for a Document Mail Queue email message.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
The queue entry no. |
Integer |
vReportID |
The ID of the report object to use for generating the attachment. |
Code[20] |
vCustomReportLayoutCode |
The code of the custom report layout to use for generating the attachment. |
Text[250] |
vReportLayoutName |
The name of the report layout to use for generating the attachment. |
Guid |
vReportLayoutAppID |
The corresponding app ID for the report layout to use for generating the attachment (only for extension-provided report layouts). |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Code[10] |
pSequenceNo |
The report selection sequence no. to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
Integer |
pDocumentTableID |
The document table ID. |
Code[20] |
pDocumentNo |
The document no. |
RecordRef |
vRecRefSourceDoc |
The source document. |
Codeunit "Temp Blob" |
vCduTempBlob |
The Temp Blob to write the PDF to. |
Boolean |
vSuccess |
Specifies whether retrieving the document report attachment was successful. |
wlEvpOnGetEmailBody
Allows to implement getting the email body to use for emailing for a queue entry.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
The queue entry no. |
Integer |
vEmailBodyReportID |
The ID of the report object to use for generating the email body. |
Code[20] |
vEmailBodyCustomReportLayoutCode |
The code of the custom report layout to use for generating the email body. |
Text[250] |
vEmailBodyLayoutName |
The name of the report layout to use for generating the email body. |
Guid |
vEmailBodyLayoutAppID |
The corresponding app ID for the report layout to use for generating the email body (only for extension-provided report layouts). |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage to email for. |
Integer |
pSourceTableID |
The source table ID (customer, vendor) |
Code[20] |
pSourceNo |
The source no. (customer no., vendor no.) |
RecordRef |
vRecRefSourceDoc |
The source document. |
OutStream |
vOutStreamEmailBody |
The OutStream to write the HTML email body to. |
Boolean |
vSuccess |
true if the email body was retrieved successfully. |
wlEvpOnGetSourceTableIDAndSourceNoForDocument
Allows to implement retrieving the table ID and source entity no. for a document.
Parameters
Type |
Name |
Description |
Variant |
pDocRecRelatedVariant |
The document record. |
Integer |
vSourceTableID |
The table ID of the source entity (customer/vendor). |
Code[20] |
vSourceNo |
The no. of the source entity (customer/vendor). |
wlEvpOnSendEmail
Allows to implement sending a Document Mail Queue email message.
Parameters
Type |
Name |
Description |
Integer |
pQueueEntryNo |
Entry No (PK) of the Document Mail Queue record |
Codeunit "Email Message" |
vCduEmailMessage |
The email message to send. |
Record "Report Selections" temporary |
vRecTempAttachmentReportSelection |
The attachment report selection. |
Enum "Report Selection Usage" |
pReportSelectionUsage |
The report selection usage. |
Code[10] |
pSequenceNo |
The sequence no. of the report selection. |
Integer |
pSourceTableID |
The ID/number of the source entity table (customer/vendor). |
Code[20] |
pSourceNo |
The no. of the source entity (customer/vendor). |
Integer |
pDocumentTableID |
The ID/number of the document table. |
Code[20] |
pDocumentNo |
The number of the document. |
RecordRef |
vRecRefSourceDoc |
A recordref of the source entity. |
Codeunit "Temp Blob" |
vCduTempBlobReportAttachment |
A TempBlob containing the document report attachment that is sent with the e-mail message. |
Boolean |
vEmailSent |
Specifies if sending the email was successful. |