Codeunit 18122024 EOS Adv Mail Routines

Codeunit 18122024 EOS Adv Mail Routines

Methods

GetEMailList

procedure GetEMailList(AdvDocRequest: Record "EOS AdvDoc Request"; AdvDocDocuments: Record "EOS AdvDoc Documents"; AddressType: Integer; var TempAdvDocRecipients: Record "EOS AdvDoc Recipients"): Text

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

  • AdvDocDocuments Record "EOS AdvDoc Documents"

  • AddressType Integer

  • TempAdvDocRecipients Record "EOS AdvDoc Recipients"

  • Returns Text[]


AutoSplitMultiMail

procedure AutoSplitMultiMail(var LastEntryNo: Integer;var AdvDocRecipients: Record "EOS AdvDoc Recipients";EmailAddresses: Text): Boolean

Parameters / Return Value

  • LastEntryNo Integer

  • AdvDocRecipients Record "EOS AdvDoc Recipients"

  • EmailAddresses Text[]

  • Returns Boolean


GetDocumentEmailTextList2

procedure GetDocumentEmailTextList2(AdvDocRequest: Record "EOS AdvDoc Request"; AddressType: Option "To",CC,BCC,From) result: Text

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

  • AddressType Option

    "To" (0) , CC (1) , BCC (2) , From (3)

  • Returns Text[]


GetDocumentEmailTextList

procedure GetDocumentEmailTextList(AdvDocDocuments: Record "EOS AdvDoc Documents"; AddressType: Option "To",CC,BCC,From) result: Text

Parameters / Return Value

  • AdvDocDocuments Record "EOS AdvDoc Documents"

  • AddressType Option

    "To" (0) , CC (1) , BCC (2) , From (3)

  • Returns Text[]


GetDocumentEmailTextList

procedure GetDocumentEmailTextList(AdvDocDocuments: Record "EOS AdvDoc Documents"; AddressType: Option "To",CC,BCC,From; var ReadOnly: Boolean) result: Text

Parameters / Return Value

  • AdvDocDocuments Record "EOS AdvDoc Documents"

  • AddressType Option

    "To" (0) , CC (1) , BCC (2) , From (3)

  • ReadOnly Boolean

  • Returns Text[]


SetDocumentEmailTextList2

procedure SetDocumentEmailTextList2(AdvDocRequest: Record "EOS AdvDoc Request"; AddressType: Option "To",CC,BCC,From; NewEmailAddresses: Text) Changes: Boolean

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

  • AddressType Option

    "To" (0) , CC (1) , BCC (2) , From (3)

  • NewEmailAddresses Text[]

  • Returns Boolean


SetDocumentEmailTextList

procedure SetDocumentEmailTextList(AdvDocDocuments: Record "EOS AdvDoc Documents"; AddressType: Option "To",CC,BCC,From; NewEmailAddresses: Text) Changes: Boolean

Parameters / Return Value

  • AdvDocDocuments Record "EOS AdvDoc Documents"

  • AddressType Option

    "To" (0) , CC (1) , BCC (2) , From (3)

  • NewEmailAddresses Text[]

  • Returns Boolean


IsCustomer

procedure IsCustomer(var RecRef: RecordRef): Boolean

Parameters / Return Value

  • RecRef RecordRef

  • Returns Boolean


IsVendor

procedure IsVendor(var RecRef: RecordRef): Boolean

Parameters / Return Value

  • RecRef RecordRef

  • Returns Boolean


IsSalesperson

procedure IsSalesperson(var RecRef: RecordRef): Boolean

Parameters / Return Value

  • RecRef RecordRef

  • Returns Boolean


GetFieldCodeValue

procedure GetFieldCodeValue(var RecRef: RecordRef; FieldNo: Integer): Code[2048]

Parameters / Return Value

  • RecRef RecordRef

  • FieldNo Integer

  • Returns Code[2048]


GetFirstFieldCodeValue

procedure GetFirstFieldCodeValue(var RecRef: RecordRef): Code[20]

Parameters / Return Value

  • RecRef RecordRef

  • Returns Code[20]


GetEmailAddress

procedure GetEmailAddress(AdvDocRequest: Record "EOS AdvDoc Request";TableVariant: Variant;MailAddrSetup: Record "EOS AdvDoc Mail Address Setup";RaiseErrors: Boolean): Text

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

  • TableVariant Variant

  • MailAddrSetup Record "EOS AdvDoc Mail Address Setup"

  • RaiseErrors Boolean

  • Returns Text[]


GetReportSelectionUsageBySourceRecord

procedure GetReportSelectionUsageBySourceRecord(DocumentRecRef: RecordRef) Result: Integer

Parameters / Return Value

  • DocumentRecRef RecordRef

  • Returns Integer


SendMailSingle

procedure SendMailSingle(AdvDocRequest: Record "EOS AdvDoc Request";DocEntryNo: Integer;Subject: Text;Body: Text;HTMLBody: Boolean)

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

  • DocEntryNo Integer

  • Subject Text[]

  • Body Text[]

  • HTMLBody Boolean


GetEmailTextWithPlaceholdersResolved

procedure GetEmailTextWithPlaceholdersResolved(EMailTextHeader: Record "EOS E-Mail Text Header"; Template: Text; RecordId: RecordId): Text

Parameters / Return Value

  • EMailTextHeader Record "EOS E-Mail Text Header"

  • Template Text[]

  • RecordId RecordId

  • Returns Text[]


ResolvePlaceholdersWithReadableTags

procedure ResolvePlaceholdersWithReadableTags(EMailTextHeader: Record "EOS E-Mail Text Header"; TextLine: Text): Text

Parameters / Return Value

  • EMailTextHeader Record "EOS E-Mail Text Header"

  • TextLine Text[]

  • Returns Text[]


ConvertReadableTagsToPlaceholders

procedure ConvertReadableTagsToPlaceholders(EMailTextHeader: Record "EOS E-Mail Text Header"; TextLine: Text): Text

Parameters / Return Value

  • EMailTextHeader Record "EOS E-Mail Text Header"

  • TextLine Text[]

  • Returns Text[]


GetPlaceHolderList

procedure GetPlaceHolderList(EMailTextHeader: Record "EOS E-Mail Text Header"; var TmpNameValueBuffer: Record "Name/Value Buffer")

Parameters / Return Value

  • EMailTextHeader Record "EOS E-Mail Text Header"

  • TmpNameValueBuffer Record "Name/Value Buffer"


MinValue

procedure MinValue(FirstValue: Integer; SecondValue: Integer): Integer

Parameters / Return Value

  • FirstValue Integer

  • SecondValue Integer

  • Returns Integer


MinValue

procedure MinValue(FirstValue: Integer; SecondValue: Integer; ThirdValue: Integer): Integer

Parameters / Return Value

  • FirstValue Integer

  • SecondValue Integer

  • ThirdValue Integer

  • Returns Integer


FindCommonFileName

procedure FindCommonFileName(var AdvDocFiles: Record "EOS AdvDoc Files"): Text

Parameters / Return Value

  • AdvDocFiles Record "EOS AdvDoc Files"

  • Returns Text[]


HandleMenulist

procedure HandleMenulist(DialogCaption: Text; Chooses: List of [Text]; DefaultChoose: Text) Result: Text

Parameters / Return Value

  • DialogCaption Text[]

  • Chooses List[Text]

  • DefaultChoose Text[]

  • Returns Text[]


StartSessionIfNoJQAvailable

procedure StartSessionIfNoJQAvailable(var AdvDocProcessingLog: Record "EOS AdvDoc Processing Log")

Parameters / Return Value

  • AdvDocProcessingLog Record "EOS AdvDoc Processing Log"

Events

OnBeforeGetFieldCodeValue

local procedure OnBeforeGetFieldCodeValue(var RecRef: RecordRef; SalesHeaderFieldNo: Integer; var CodeValue: Code[2048]; var Handled: Boolean)

Creating a request on a custom/unsupported table ADR needs to knows some values from the table. The ADR raises this event by passing in the record and field number of the “Sales Header” that the value needs. For example, the field number might be “Salesperson Code” (F43), and the subscriber must respond with the value because he knows the table.

Parameters / Return Value

  • RecRef RecordRef

    Current Record

  • SalesHeaderFieldNo Integer

    Number of the field requested if it was the “Sales Header”

  • CodeValue Code[2048]

    Returning value

  • Handled Boolean

    If this parameter is “true” ADR will skip standard field search.


OnAfterGetDestinationList

procedure OnAfterGetDestinationList(var AdvDocRequest: Record "EOS AdvDoc Request"; AdvDocDocuments: Record "EOS AdvDoc Documents"; AddressType: Integer; var TempAdvDocRecipients: Record "EOS AdvDoc Recipients")

This event is raised after build a recipient list. You can remove, update o add recipients

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

    Current Request

  • AdvDocDocuments Record "EOS AdvDoc Documents"

    Current Request Document

  • AddressType Integer

    maps “EOS AdvDoc Mail Address Setup”.“EOS Address Type” option values

  • TempAdvDocRecipients Record "EOS AdvDoc Recipients"

    Recipient list


OnCustomerVendorTableArea

procedure OnCustomerVendorTableArea(RecRef: RecordRef; var CustomerVendorTableNo: Integer)

The module needs to know if a table is in the sales or purchase area.

Parameters / Return Value

  • RecRef RecordRef

  • CustomerVendorTableNo Integer

    Return 18 for sales area and 23 for purchase area


OnBeforeGetEmailAddress

procedure OnBeforeGetEmailAddress(AdvDocRequest: Record "EOS AdvDoc Request";TableVariant: Variant;MailAddrSetup: Record "EOS AdvDoc Mail Address Setup";var MailText: Text;var Handled: Boolean)

Email engine require an Email text from master tables (customer/vendor/…). With this event you can customize Email address

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

    Current Request

  • TableVariant Variant

    is the current record/document

  • MailAddrSetup Record "EOS AdvDoc Mail Address Setup"

    is the current Email setup.

  • MailText Text[]

    Mail Address text

  • Handled Boolean

    Check this parameter before execute your process and set to true when you populate “MailText” with a valid value


OnBeforeSendMail

procedure OnBeforeSendMail(AdvDocRequest: Record "EOS AdvDoc Request"; AdvDocDocuments: Record "EOS AdvDoc Documents"; var Subject: Text; var Body: Text; var HTMLBody: Boolean; var Handled: Boolean)

This event is raised when this module need to send a mail. You can override the default email processing at all or change Subject/Body before standard mail creation.

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

    Current Request

  • AdvDocDocuments Record "EOS AdvDoc Documents"

    Current Request Document

  • Subject Text[]

    Current Mail Subject.

  • Body Text[]

    Current Body.

  • HTMLBody Boolean

    Specidy if the body is HTML format.

  • Handled Boolean

    Set this value to true to skip standard email sending process.


OnAfterSendMail

procedure OnAfterSendMail(AdvDocRequest: Record "EOS AdvDoc Request"; AdvDocDocuments: Record "EOS AdvDoc Documents"; Subject: Text; Body: Text; HTMLBody: Boolean)

This event is raised at the end of the standard mail sending. If the sending process raises an error, this event is not invoked. Before calling this event a COMMIT is executed.

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

    Current Request

  • AdvDocDocuments Record "EOS AdvDoc Documents"

    Current Request Document

  • Subject Text[]

    Current Mail Subject.

  • Body Text[]

    Current Body.

  • HTMLBody Boolean

    Specidy if the body is HTML format.


OnGetPlaceholders

local procedure OnGetPlaceholders(var Placeholders: Record "Name/Value Buffer"; Header: Record "EOS E-Mail Text Header")

This event is raised when Email page require the placeholder list

Parameters / Return Value

  • Placeholders Record "Name/Value Buffer"

    Temporary list of name (tag) and value (readable description)

  • Header Record "EOS E-Mail Text Header"

    Current Email Text Header. “EOS Table No.” could be populated or not.


OnResolvePlaceholder

local procedure OnResolvePlaceholder(SourceRecord: RecordRef; PlaceholderName: Text; var ResultValue: Text; var DoReplacement: Boolean)

This event is raised when Email engine requires a real body/subject

Parameters / Return Value

  • SourceRecord RecordRef

    is the current record/document

  • PlaceholderName Text[]

    is the placeholder name to convert to a value

  • ResultValue Text[]

    is the replaced value

  • DoReplacement Boolean

    a blank -ResultValue- parameter could be a replaced result or not. Check this value to skip your subscriber processing.


OnAfterMailSetupTableFiltering

local procedure OnAfterMailSetupTableFiltering(AdvDocRequest: Record "EOS AdvDoc Request";DocumentRecRef: RecordRef;var MailAddrSetup: Record "EOS AdvDoc Mail Address Setup")

This event is raised after applying standard filters to MailAddrSetup. You can customize all filters at your own risk.

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

    Current Request

  • DocumentRecRef RecordRef

    Current Document

  • MailAddrSetup Record "EOS AdvDoc Mail Address Setup"

    Current Mail Setup


OnBeforeProcessingMailSetup

local procedure OnBeforeProcessingMailSetup(AdvDocRequest: Record "EOS AdvDoc Request";DocumentRecRef: RecordRef;MailAddrSetup: Record "EOS AdvDoc Mail Address Setup";var LastEntryNo: Integer;var TempAdvDocRecipients: Record "EOS AdvDoc Recipients";var Handled: Boolean)

This event is raised before a compatible setup is performed

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

    Current Request

  • DocumentRecRef RecordRef

    Current Document

  • MailAddrSetup Record "EOS AdvDoc Mail Address Setup"

    Current Mail Setup

  • LastEntryNo Integer

    Last temp AdvDocRecipients Entry no.

  • TempAdvDocRecipients Record "EOS AdvDoc Recipients"

    Final Recipient List

  • Handled Boolean

    Set this property to True to skip all standard processing


OnProcessingCustomMailSetup

local procedure OnProcessingCustomMailSetup(AdvDocRequest: Record "EOS AdvDoc Request";DocumentRecRef: RecordRef;MailAddrSetup: Record "EOS AdvDoc Mail Address Setup";var LastEntryNo: Integer;var TempAdvDocRecipients: Record "EOS AdvDoc Recipients")

This event is raised when a compatible setup is found on an extend “AdvDoc Setup SourceType” enum.

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

    Current Request

  • DocumentRecRef RecordRef

    Current Document

  • MailAddrSetup Record "EOS AdvDoc Mail Address Setup"

    Current Mail Setup

  • LastEntryNo Integer

    Last temp AdvDocRecipients Entry no.

  • TempAdvDocRecipients Record "EOS AdvDoc Recipients"

    Final Recipient List


OnAfterProcessingMailSetup

local procedure OnAfterProcessingMailSetup(AdvDocRequest: Record "EOS AdvDoc Request";DocumentRecRef: RecordRef;MailAddrSetup: Record "EOS AdvDoc Mail Address Setup";var LastEntryNo: Integer;var TempAdvDocRecipients: Record "EOS AdvDoc Recipients")

This event is raised after a compatible setup has already been performed.

Parameters / Return Value

  • AdvDocRequest Record "EOS AdvDoc Request"

    Current Request

  • DocumentRecRef RecordRef

    Current Document

  • MailAddrSetup Record "EOS AdvDoc Mail Address Setup"

    Current Mail Setup

  • LastEntryNo Integer

    Last temp AdvDocRecipients Entry no.

  • TempAdvDocRecipients Record "EOS AdvDoc Recipients"

    Final Recipient List


OnBeforeGetReportSelectionUsageBySourceRecord

local procedure OnBeforeGetReportSelectionUsageBySourceRecord(DocumentRecRef: RecordRef; var ResultUsage: Integer; var Handled: Boolean)

This event is raised before standard Report Selection search BUT after checking the global shared memory report selection usage. So “Result” could be -1 if un initialized or different from -1 if populated by global shared memory report selection usage.

Parameters / Return Value

  • DocumentRecRef RecordRef

    sSource Document Record

  • ResultUsage Integer

    Exit value of report usage search function

  • Handled Boolean

    Return true to skip standard search


OnAfterGetReportSelectionUsageBySourceRecord

local procedure OnAfterGetReportSelectionUsageBySourceRecord(DocumentRecRef: RecordRef; var ResultUsage: Integer)

This event is raised at the end of the procedure. ResultUsage is -1 if no report selection is found.

Parameters / Return Value

  • DocumentRecRef RecordRef

    sSource Document Record

  • ResultUsage Integer

    Exit value of report usage search function



EOS Labs -