Skip to main content

Extensibility

The Australia/New Zealand Accelerator publishes integration events and public procedures so that a partner extension can change behaviour, add data, or drive a process unattended without us having to change the app.

This page is the reference for the application extensibility surface. Extending the document layouts and report datasets is covered separately in Extending Theta Document Templates.

note

Objects and members not listed here are internal. Internal members can change at any time without notice, so please do not take a dependency on them. If you need something that is not published, contact us and we will look at exposing it.

Where an event is published from a table extension, the publishing object is the standard Business Central table, so subscribe with Database::"Sales Invoice Header" rather than the extension. These events carry the _ACC_TSL suffix in the event name.


Running processes unattended​

These procedures let another extension run the payment suggestion and EFT processes from a job queue or an API, with no user interaction.

Suggest Customer Payments / Suggest Vendor Payments​

report 70254475 "Sug. Customer Payments_ACC_TSL" and report 70254477 "Sugg. Vendor Payments_ACC_TSL".

ProcedurePurpose
InitializeRequest(...)Sets the request page options (last payment date, payment discount, available amount, posting date, starting document no., summarise per customer/vendor, balancing account, bank payment type) so the report can be run without showing the request page.
SetGenJnlLine(GenJournalLine)Sets the journal template and batch that the suggested lines are written to.
SetSuppressConfirmDialogs(Boolean)Suppresses the confirmation dialogs the batch job would normally show.
SetMaxLinesToProcess(Integer)Caps the number of journal lines a single run will create. Use this to split a large payment run across several journal batches.
GetLinesProcessed()Returns the number of lines the run actually created, so the caller knows whether more runs are needed.
SetIsDirectCredit()Suggest Customer Payments only. Marks the run as a direct credit (customer refund) run.

A batched run looks like this:

SuggVendorPayments.InitializeRequest(LastPmtDate, false, 0, false, PostingDate, StartDocNo, true, BalAccType, BalAccNo, BankPmtType);
SuggVendorPayments.SetGenJnlLine(GenJournalLine);
SuggVendorPayments.SetSuppressConfirmDialogs(true);
SuggVendorPayments.SetMaxLinesToProcess(500);
SuggVendorPayments.UseRequestPage(false);
SuggVendorPayments.RunModal();
LinesCreated := SuggVendorPayments.GetLinesProcessed();

Generating and sending the EFT file​

ObjectProcedurePurpose
codeunit 70254471 "Generate EFT Payment_ACC_TSL"Initialize(...)Prepares the EFT Transfer header - bank account, transaction date, document no., description, summarisation, posting date update, and transaction type. Call this and then run the codeunit with the Gen. Journal Batch.
codeunit 70254471 "Generate EFT Payment_ACC_TSL"WarnIfMultipleEntriesForSameCustOrVendor(...)Performs the same duplicate payment check that the Generate EFT Payments report performs before it generates.
codeunit 70254471 "Generate EFT Payment_ACC_TSL"GetReferenceText(EFTTransferLine)Returns the reference text for an EFT Transfer Line.
codeunit 70254470 "EFT Management_ACC_TSL"GenerateEFTFile(EFTTransferHeader)Creates the EFT export file and updates the EFT File Status.
codeunit 70254470 "EFT Management_ACC_TSL"SendEFTFileToBank(EFTTransferHeader, ShowConfirmation)Sends the file using the bank's host-to-host integration. Pass false for ShowConfirmation when running unattended. Requires a Premium subscription.
tableextension 70254477 on Gen. Journal LineGetEFTTransferHeader_ACC_TSL(EFTTransferHeader, ShowMessage)Returns the EFT Transfer created from a payment journal line. Pass false for ShowMessage when running unattended.
caution

WarnIfMultipleEntriesForSameCustOrVendor takes a WarningType of Notification, Confirmation or Show Duplicate List. When there is no client, pass Notification - the notification is discarded - and act on the returned warning text instead. Passing Confirmation will wait on a confirmation that nobody can answer.

To pick the generated file up in your own code rather than downloading it, subscribe to EFTFileGeneratingProcessCompleted, which passes the generated file as a TempBlob.


Banking and EFT events​

EFT file generation and transmission​

codeunit 70254470 "EFT Management_ACC_TSL"

EventRaised
EFTFileGeneratingProcessCompletedAfter the EFT file has been generated. Passes the EFT Transfer header, the download-to-client flag, and the generated file as a TempBlob.
EFTFileStatusChangedWhen the EFT File Status changes.
OnBeforeCancelEFTFileBefore an EFT file is cancelled.
OnBeforeChangeEFTFileStatusToUploadingToBankBeforeGeneratingFileBefore the status is set to Uploading to Bank as part of generating the file.
note

The file is only written to internal temp storage when it is actually needed - that is, when the bank account is set to download to client or upload to external storage, or when there is an active subscriber to EFTFileGeneratingProcessCompleted.

EFT payment generation​

codeunit 70254471 "Generate EFT Payment_ACC_TSL"

EventRaised
OnBeforeGetReferenceText / OnAfterGetReferenceTextAround building the reference text for an EFT Transfer Line.
OnBeforeGetReferenceTextHeader / OnAfterGetReferenceTextHeaderAround building the reference text for the EFT Transfer header.
OnAfterTryGetVendorAccountDetailsAfter the vendor bank account details have been resolved for a payment line.
OnBeforeInsertEFTLineBefore each EFT Transfer Line is inserted.
OnBeforeUpdateRecipientBankAccountNoBefore the recipient bank account number is set on the journal line.

report 70254471 "GenerateEFTPayments_ACC_TSL"

EventRaised
OnBeforeFindDefaultBankAccount / OnAfterFindDefaultBankAccountAround resolving the default bank account for the run.

EFT feedback from the bank​

codeunit 70254426 "ProcessEFTFeedback_ACC_TSL"

EventRaised
OnResolveEFTTransferHeaderFallbackWhen the standard EFT Transfer header lookup fails. Lets a bank-specific extension supply the header - for example by matching on the bank's own message reference. See EFT Transfers.
OnBeforeGetEffectiveEFTFileNoBefore the effective EFT file number is resolved. Lets a subscriber override which file the feedback applies to.
OnBeforeGetEffectiveEFTFileLineNoBefore the effective EFT line number is resolved. Lets a subscriber override which line the feedback applies to.
OnBeforePostJournalsAfter all feedback lines have been processed and before the journal is auto-posted.

codeunit 70254418 "Journal Posting_ACC_TSL"

EventRaised
OnBeforeAutoPostJournalBefore a journal is automatically posted.

EFT Transfer Lines​

table 70254474 "EFTTransferLine_ACC_TSL"

EventRaised
OnBeforeSendRecordsBefore remittance or payment advice documents are sent from the EFT lines.
OnBeforeEmailRecordsBefore remittance or payment advice documents are emailed from the EFT lines.
OnBeforeShowAppliedEntriesAfterSourceLedgerEntryCheckBefore the applied entries are shown from an EFT line. The EFT File Line is passed by var.

Suggest Customer Payments​

report 70254475 "Sug. Customer Payments_ACC_TSL"

EventRaised
CheckRefundSuggestionRuleLets you override the standard rule that only suggests a refund when there is an amount owing.
OnBeforeGetCustomerBankAccountLets a subscriber resolve the customer bank account for one suggested line instead of using the customer-wide default.
OnBeforeHandledCustLedgEntryBefore a customer ledger entry is handled. Use to skip or change handling of an entry.
OnGetCustLedgEntriesOnBeforeLoopBefore the customer ledger entry loop starts. Use to change the filters applied.

Suggest Vendor Payments​

report 70254477 "Sugg. Vendor Payments_ACC_TSL"

EventRaised
OnAfterPreReportAfter the report's pre-report processing.
OnAfterAfterGetRecordVendorAfter each vendor has been processed.
OnGetVendLedgEntriesOnBeforeLoopBefore the vendor ledger entry loop starts. Use to change the filters applied.
OnBeforeHandledVendLedgEntryBefore a vendor ledger entry is handled. Use to skip or change handling of an entry.
OnUpdateTempVendorPaymentBufferFromVendorLedgerEntryWhile the payment buffer is being built from a vendor ledger entry.
OnAfterUpdateTempVendorPaymentBufferAfter the payment buffer has been updated.
OnBeforeUpdateGnlJnlLineDimensionsFromTempVendorPaymentBuffer / OnAfterUpdateGnlJnlLineDimensionsFromTempVendorPaymentBufferAround copying dimensions from the payment buffer to the journal line. Use to override the dimensions applied to payment journals.
OnBeforeInsertGenJournalLineBefore each suggested journal line is inserted.
OnBeforeTryGetEFTVendorBankAccountBefore the EFT vendor bank account is resolved for a suggested line.

Bank account validation and workflow​

ObjectEventRaised
tableextension 70254474 on Customer Bank AccountOnBeforeTryGetEFTCustomerBankAccount_ACC_TSLLets an app resolve the EFT bank account itself instead of using the customer-wide default.
tableextension 70254472 on Vendor Bank AccountOnBeforeCheckDefaultBankAccount_ACC_TSLBefore the default vendor bank account is checked.
codeunit 70254482 "Workflow Event_ACC_TSL"OnBeforeProcessingCustBankAccChangedWorkFlowBefore the customer bank account changed workflow is processed.
codeunit 70254482 "Workflow Event_ACC_TSL"OnBeforeProcessingVendorBankAccChangedWorkFlowBefore the vendor bank account changed workflow is processed.

Host-to-host integration and bank statements​

ObjectEventRaised
codeunit 70254413 PaymentPublisher_ACC_TSLOnAfterEFTPaymentResponseRetrievedAfter the bank's payment response has been retrieved.
codeunit 70254413 PaymentPublisher_ACC_TSLOnAfterRetrievedPaymentPublisherStatusAfter the payment publisher status has been retrieved.
codeunit 70254411 "ProcessBankStatEntry_ACC_TSL"OnBeforeGetBankStatementDate / OnAfterGetBankStatementDateAround resolving the statement date for an imported bank statement entry.
codeunit 70254448 "ProcessWestpacBankStat_ACC_TSL"BankStatementEntriesReadyToProcessWhen imported Westpac statement entries are ready to be processed.
codeunit 70254449 "ProcessWindcaveBankSta_ACC_TSL"BankStatementEntriesReadyToProcessWhen imported Windcave settlement entries are ready to be processed.
codeunit 70254449 "ProcessWindcaveBankSta_ACC_TSL"OnBeforeImportWindcaveBankStatement / OnAfterImportWindcaveBankStatementAround importing the Windcave settlement statement.

Currency exchange rate events​

See Currency Exchange Rate Service for the feature itself.

ObjectEventRaised
codeunit 70254454 "Currency Exchange Mgmt_ACC_TSL"OnFetchCurrencyRatesLets you implement a custom currency rate provider.
table 70254442 "Curr. Provider_ACC_TSL"OnBeforeCallTestConnectionBefore the provider's Test Connection action calls the provider.

Document sending and emailing events​

See Document Configuration for the features these events relate to.

Sending and printing​

ObjectEventRaised
codeunit 70254422 "DocumentSendingProfile_ACC_TSL"OnBeforeAutoSendSalesOrderOrReturnOrderBefore a sales order or return order is sent automatically, so you can change the automatic sending behaviour.
codeunit 70254422 "DocumentSendingProfile_ACC_TSL"OnBeforeAutoSendSalesOrderBeforeCheckIfSentPreviouslyBefore the "already sent" check on automatic sales order sending.
codeunit 70254422 "DocumentSendingProfile_ACC_TSL"OnBeforeAutoSendPurchaseOrderBeforeCheckIfSentPreviouslyBefore the "already sent" check on automatic purchase order sending.
report 70254423 "SendPostedSalesInv_ACC_TSL"OnAfterCheckingCustomReportSelectionAfter the Send Posted Documents batch job has checked the custom report selection for a document.
codeunit 70254459 "InvoiceAttachmentMgt_ACC_TSL"OnAfterHandleAttachmentsAfter the attachments for an emailed document have been assembled. See Merge Email Attachments.

The following events are published from table extensions on standard tables:

Base tableEvents
Sales Invoice HeaderOnBeforeSendProfileCustom_ACC_TSL, OnBeforeSendRecordsCustom_ACC_TSL, OnBeforePrintRecordsCustom_ACC_TSL, OnBeforeEmailRecordsCustom_ACC_TSL
Sales Shipment HeaderOnBeforeSendRecords_ACC_TSL
Purchase HeaderOnBeforeSendProfileCustom_ACC_TSL, OnBeforeSendRecordsCustom_ACC_TSL, OnBeforePrintRecordsCustom_ACC_TSL
Purch. Inv. HeaderOnBeforeSendProfileCustom_ACC_TSL, OnBeforeSendRecordsCustom_ACC_TSL

Email addresses and name formats​

ObjectEventRaised
codeunit 70254410 "Doc. EMail Mgmt_ACC_TSL"OnCustomGetTableFromUsageLets you map a custom report usage to the table it applies to, so your own documents can use the app's emailing.
codeunit 70254410 "Doc. EMail Mgmt_ACC_TSL"OnBeforeTryGetVariantFromDocNoUsageBefore the document record is resolved from the document number and usage.
table 70254406 "EmailNameFormat_ACC_TSL"OnBeforeValidateEmailAddressBefore an email address is validated. See Email Address Validation.
table 70254406 "EmailNameFormat_ACC_TSL"OnBeforeValidateForValidTokenThetaEFTBefore a token in an Email Name Format is validated.

Report selection events​

ObjectEventRaised
codeunit 70254408 "Report Selection Mgt._ACC_TSL"OnBeforeCopyFromReportSelectionsBefore report selections are copied to customer document layouts.
codeunit 70254408 "Report Selection Mgt._ACC_TSL"OnBeforeAddModifyCustomLayoutFromUpdateBefore a customer document layout is added or modified by the automatic update.
codeunit 70254408 "Report Selection Mgt._ACC_TSL"OnBeforeAutoUpdateCustomerDocumentLayoutEmailsBefore the email addresses on customer document layouts are updated automatically.
codeunit 70254408 "Report Selection Mgt._ACC_TSL"OnMapReportUsageToSalesReportUsageMaps a report selection usage to the sales report usage.
codeunit 70254408 "Report Selection Mgt._ACC_TSL"OnMapReportUsageToCustomReportSelectionSales / OnMapCustomReportSelectionSalesToReportUsageMap between the standard Report Selection Usage and Custom Report Selection Sales enums, so that a custom usage added by your extension is handled. See Report Usage Mapping.
pageextension 70254406 on Report Selection - SalesOnValidateUsage_ACC_TSLWhen the usage is validated on the Report Selection - Sales page.
caution

OnMapReportUsageToCustomReportUsage is obsolete (tag 27.0) and will be removed. Use the standard enum mapping events above instead.


Document content events​

These events change what appears on a Theta document. The layout side - custom fields, comment lines, and report extensions - is covered in Extending Theta Document Templates.

Document settings and custom fields​

table 70254411 "ThetaDocumentSetting_ACC_TSL"

EventRaised
OnBeforeGetTextValueForCustomTextWithDocLineBufferWhen the value for a custom text field is needed. This is the main event for adding calculated values to a document.
OnBeforeOutputDocumentLines / OnAfterOutputDocumentLinesAround outputting the document lines. Use to reset globals, or to change the lines before they print.
OnBeforeGetCustomFieldDefaultsLets your extension define custom fields so they are created automatically when the extension is installed. See Defaulting Custom Fields.
OnBeforeGetTableRelationDefaultsLets your extension default the custom table relations used by custom fields.
OnBeforeGetCustLayoutDefaultsLets your extension default customer document layout selections.
OnAfterGetReportSettingsAfter the report settings have been read. Use to apply defaults from your extension.
OnAfterGetOrInsertReportSettingsDuringInstallOrUpgradeWhen report settings are created during install or upgrade. See Defaulting Document Settings.
OnAfterInitialiseReportSettingsForStandardThetaDocumentsLets you initialise document settings for your own report when the extension is installed.
OnBeforeAssignRecordRefBefore a record reference is assigned while resolving a field value.
OnBeforeFormatFieldBefore a field value is formatted for output.
OnBeforeFinishInitConfigurableSystemFieldsBefore initialisation of the configurable system fields completes.
OnBeforeGenerateDocumentBarCode / OnBeforeGenerateDocumentBarCodeStandardBefore a barcode is generated for a document. See Barcodes on Documents.

table 70254410 "ThetaDocCustomField_ACC_TSL"

EventRaised
OnAssistSystemFieldWhen the assist edit is used on a system field.
OnValidateSystemFieldWhen a system field is validated.

Company details and extended text​

ObjectEventRaised
table 70254400 "Doc. Template Setup_ACC_TSL"OnAfterFormatCompanyAddressAfter the company address has been formatted. The source document is passed so subscribers can interrogate document dimensions.
table 70254418 "DocumentExtendedText_ACC_TSL"OnBeforeAddSalesDocumentExtendedTextToDocLineBufferBefore Document Extended Text is added to the document.
codeunit 70254400 "Text Helper_ACC_TSL"OnBeforePrepareDocLineDescriptionBefore a document line description is prepared, including wrapping.

Document line buffers​

ObjectEventRaised
table 70254401 "Sales Doc. Line Buffer_ACC_TSL"OnAfterInsertSalesDocLineBufferAfter a sales document line buffer record is inserted.
table 70254402 "Purch. Doc. Line Buf_ACC_TSL"OnAfterInsertPurchDocLineBufferAfter a purchase document line buffer record is inserted.

Document aggregation​

codeunit 70254438 "DocAggrRepHandler_ACC_TSL" - see Document Aggregation.

EventRaised
OnBeforeInsertAggregatedSalesDocLineBufferBefore an aggregated buffer line is inserted, so you can change it.
OnFindAggregatedLineByCustomFieldLets you aggregate by a custom field.

Document report events​

Most Theta documents publish the same small set of events. Rather than repeat them, they are described once here and the matrix below shows which reports publish which.

EventRaised
OnBeforeCopyDocumentLineToDocLineBufferBefore a source document line is copied into the document line buffer. Use to skip a line or pre-set buffer values.
OnAfterCopyDocumentLineToDocLineBufferAfter a source document line has been copied into the document line buffer. Use to change buffer values.
OnBeforeInsertingFreeLinesNeededBefore the free (blank) lines needed to pad the page are inserted.
OnBeforeAddingTrackingLinesBefore lot and serial tracking lines are added to the document.
OnBeforeInsertDocLineBufferBefore a buffer line is inserted on the warehouse documents.

Sales documents​

ReportCopy BeforeCopy AfterFree LinesTracking
70254401 SalesQuote_ACC_TSLYesYesYes
70254402 SalesOrder_ACC_TSLYesYesYes
70254403 SalesCreditMemo_ACC_TSLYesYesYesYes
70254404 SalesInvoice_ACC_TSLYesYesYesYes
70254405 SalesShipment_ACC_TSLYes
70254409 SalesCommercialInvoice_ACC_TSLYesYesYesYes
70254415 SalesProformaInvoice_ACC_TSLYesYesYes
70254418 SalesReturnOrder_ACC_TSLYesYesYes
70254420 SalesReturnCollection_ACC_TSLYesYesYesYes
70254426 SalesOrderPackSlip_ACC_TSLYesYesYesYes
70254429 SalesProformaCredMemo_ACC_TSLYesYesYes

Purchase documents​

ReportCopy BeforeCopy AfterFree LinesAdditional
70254400 PurchBuyerCreatedInv_ACC_TSLYesYes
70254406 PurchaseOrder_ACC_TSLYesYesYesOnAfterAddCustVendItemNo
70254408 DraftPurchaseInvoice_ACC_TSLYesYesYes
70254432 PurchaseQuote_ACC_TSLYesYesYes

Warehouse and transfer documents​

ReportCopy BeforeCopy AfterFree LinesTrackingAdditional
70254416 WhsePackingSlip_ACC_TSLYesYesYesOnBeforeInsertDocLineBuffer, OnBeforeDocumentDetailHeaderfilter
70254419 WhseInternalPick_ACC_TSLYesYesOnBeforeInsertDocLineBuffer
70254421 WhseShipment_ACC_TSLYesYesYesOnBeforeAddSourceDocInfo, OnBeforePrepareShipToAddress
70254422 WhseShipmentPosted_ACC_TSLYesYesYesOnBeforeAddSourceDocInfo, OnBeforePrepareShipToAddress
70254427 TransferOrder_ACC_TSLYesYesYes
70254431 TransferShipment_ACC_TSLYesYesYes

OnBeforeDocumentDetailHeaderfilter lets you change the filters applied to the document detail header. OnBeforeAddSourceDocInfo lets you change the source document information shown per shipment, and OnBeforePrepareShipToAddress lets you change the address details shown per shipment.

Customer Statement​

report 70254424 "CustomerStatementBBF_ACC_TSL" - see Customer Statement.

EventRaised
OnBeforeInsertTempCustomerStatementBufBefore a statement buffer line is inserted.
OnBeforeModifyCustomerStatementLineBefore a statement line is modified.
OnBeforeUpdateOfLineCounterBefore the line counter is updated.
OnBeforeWrapDescriptionTextBefore the description is wrapped.
OnBeforeInsertWrappedDescriptionLineBefore a wrapped description line is inserted.
OnBeforeAssignAgingBandColumnHeadersBefore the ageing band column headings are assigned.

Warehouse events​

ObjectEventRaised
codeunit 70254423 "WarehouseDocumentMgt_ACC_TSL"OnBeforeGetLotSerialInformationTextBefore the lot and serial information text is built for a warehouse document.
codeunit 70254414 "WarehouseMgtSubscriber_ACC_TSL"OnAfterIntegrationStagingEntryCreatedForNewPickAfter a staging entry has been created for a new pick.
codeunit 70254414 "WarehouseMgtSubscriber_ACC_TSL"OnAfterIntegrationStagingEntryCreatedForRegisterdPickAfter a staging entry has been created for a registered pick.
table 70254419 "RegWhseActivityDetail_ACC_TSL"OnBeforePrintRecordsBefore registered warehouse activity records are printed.
codeunit 70254415 "RegWhse.-Printed_ACC_TSL"OnBeforeModifyBefore the printed flag is written back to the registered warehouse activity.