Skip to main content

Extending Theta Document Templates

Document Layouts

We designed the Theta Document Templates to be easy to tailor to our customers' needs. We created a set of documents that share the same base layout which means that it is possible to change the layout for one report and copy that to a different report. This is a significant time saver.

If your partner is making the custom layout, they should add the custom layout to the repo for your custom extension. We include an example below where we use a report extension to publish the layout.

Comments on Documents

From versions 20.x, you can now specify a different description length for comment lines on a document. The new default is 100 characters and this is made possible by a slight change to the report layout:

Previous Layout

Previous Report Layout

New Layout

New Report Layout

Adding custom fields

We are frequently asked to add custom fields to documents. This always translated to customisation. Until Business Central 2021 Wave 1, it was not possible to extend reports so these requests had to be handled by cloning the original report. We did not like this as it meant that we would have to maintain additional source code so we designed document templates that would allow you to add custom fields without. We came up with the Theta Document Settings feature, which allows you to add fields to the dataset.

However, even with the flexibility of the Theta Document Settings, we sometimes find that we need to add logic to handle special calculations. The Theta Document Settings feature has events that allow you to subscribe to this and add custom logic.

Extending Base Pack Reports

note

Since the Business Central 2021 Wave 1 release it has been possible to add report extensions instead of cloning the reports. If all you need to do is add a field that is not available in the standard dataset, then you should use the custom fields option. The main reason for this is that if you do not add to the dataset, then your layout is compatible with all the standard Theta reports that share the same data set. This makes it easier to use custom layouts for other reports.

Sample Extension

caution

You can download the sample extension here subject to the following terms and conditions.

Create your own extension

Note: This extension is provided as as an example only, as-is, and should not be used in a production environment

Some requirements cannot be met by field mapping alone because additional logic is required. In the example below, we want to show the package tracking numbers for related shipments on the sales invoice. The example also includes a custom layout to display the custom field.

Here are the steps required:

  1. Create a codeunit to subscribe to the events in the Base Pack app.
  2. Create a codeunit that contains the Business required logic to get the values.
  3. Build and deploy the extension to your environment.
  4. Select the layout.

Subscriber Codeunit

Note that this codeunit does not contain processing logic because it is recommended to keep the size of subscriber codeunits to the minimum.

codeunit 50000 "ThetaReportSubscriber_TSL"
{
[EventSubscriber(ObjectType::Table, Database::ThetaDocumentSetting_EFT_TSL, 'OnBeforeGetTextValueForCustomTextWithDocLineBuffer', '', false, false)]
local procedure OnBeforeGetTextValueForCustomTextWithDocLineBuffer(var Text: Text; ThetaDocCustField: Record ThetaDocCustomField_EFT_TSL; var HeaderRecRef: RecordRef; var LineRecRef: RecordRef; IsSubLine: Boolean; var DocLineBufferRecRef: RecordRef; var IsHandled: Boolean);
var
ThetaReportCustomFieldsMgt: Codeunit ThetaReportCustomFieldsMgt_TSL;
begin
// separate logic from subscriber codeunits
case ThetaDocCustField."Report ID" of
report::SalesInvoice_EFT_TSL:
ThetaReportCustomFieldsMgt.GetSalesInvoiceCustomText(Text, ThetaDocCustField, HeaderRecRef, LineRecRef, IsSubLine, IsHandled);
end
end;

[EventSubscriber(ObjectType::Table, Database::ThetaDocumentSetting_EFT_TSL, 'OnBeforeOutputDocumentLines', '', false, false)]
local procedure OnBeforeOutputDocumentLines(ReportIdText: Text; var HeaderRecRef: RecordRef; var LineRecRef: RecordRef);
var
ThetaReportCustomFieldsMgt: Codeunit ThetaReportCustomFieldsMgt_TSL;
begin
ThetaReportCustomFieldsMgt.InitialiseBeforeOutput(); // clear globals in the single instance codeunit
end;
}

Custom Logic

This codeunit contains the logic to get the values required. It supports one posted invoice having multiple shipments.

note

The codeunit is a Single Instance codeunit so that we can only process some logic once per document. InitialiseBeforeOutput() is invoked by the EventSubscriber OnBeforeOutputDocumentLines to clear this codeunit before the report is output. This event is fired on all Theta Documents.

codeunit 50001 "ThetaReportCustomFieldsMgt_TSL"
{
SingleInstance = true;

var
DocTemplateSetupEFTTSL: Record "Doc. Template Setup_EFT_TSL";
ShipmentNoText: Text;
PackageTrackingNoText: Text;
ShipmentDateText: Text;
LastDocumentNo: Code[20];
GotTemplateSetup: Boolean;

procedure InitialiseBeforeOutput()
begin
ClearAll();
end;

procedure GetSalesInvoiceCustomText(var Text: Text; ThetaDocCustomFieldEFTTSL: Record ThetaDocCustomField_EFT_TSL; var HeaderRecordRef: RecordRef; var LineRecordRef: RecordRef; IsSubLine: Boolean; var IsHandled: Boolean)
var
SalesInvoiceHeader: Record "Sales Invoice Header";
SalesInvoiceLine: Record "Sales Invoice Line";
PackageTrackingNoLbl: Label 'Package Tracking No.';
begin
LineRecordRef.SetTable(SalesInvoiceLine); // not required for example below but here is how you access the sales invoice line
HeaderRecordRef.SetTable(SalesInvoiceHeader); // not required for example below but here is how you access the sales invoice header

if LastDocumentNo <> SalesInvoiceHeader."No." then // example of how you can do processing only once for the document for performance reasons
UpdateShipmentInfoForInvoice(SalesInvoiceHeader);
LastDocumentNo := SalesInvoiceHeader."No.";

case ThetaDocCustomFieldEFTTSL.ID of
4:
if PackageTrackingNoText <> '' then
Text := PackageTrackingNoLbl;
5:
Text := PackageTrackingNoText;
7:
Text := ShipmentNoText;
else
exit; // very NB else last line says it has been handled but it has not
end;
IsHandled := true;
end;

local procedure UpdateShipmentInfoForInvoice(SalesInvoiceHeader: Record "Sales Invoice Header")
var
ValueEntry: Record "Value Entry";
ItemLedgerEntry: Record "Item Ledger Entry";
SalesShipmentHeader: Record "Sales Shipment Header";
begin
// included dates and package tracking info as ideas on how to save processing. Not used in example below
GetDocumentTemplateSetup();
LastDocumentNo := SalesInvoiceHeader."No.";
ShipmentDateText := '';
ShipmentNoText := '';
ValueEntry.Reset();
ValueEntry.SetCurrentKey("Document No.");
ValueEntry.SetRange("Document No.", SalesInvoiceHeader."No.");
ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Sales Invoice");
ValueEntry.SetRange("Item Charge No.", '');
if ValueEntry.FindSet() then
repeat
ItemLedgerEntry.Get(ValueEntry."Item Ledger Entry No.");
if StrPos(ShipmentNoText, ItemLedgerEntry."Document No.") = 0 then
if ShipmentNoText = '' then
ShipmentNoText := ItemLedgerEntry."Document No."
else
ShipmentNoText += ', ' + ItemLedgerEntry."Document No.";
// add package tracking no.
if SalesShipmentHeader."No." <> ItemLedgerEntry."Document No." then
if SalesShipmentHeader.Get(ItemLedgerEntry."Document No.") and (SalesShipmentHeader."Package Tracking No." <> '') then
if StrPos(ShipmentNoText, SalesShipmentHeader."Package Tracking No.") = 0 then
if PackageTrackingNoText = '' then
PackageTrackingNoText := SalesShipmentHeader."Package Tracking No."
else
PackageTrackingNoText := SalesShipmentHeader."Package Tracking No." + ', ' + ShipmentNoText;
// Shipment Dates
if StrPos(ShipmentDateText, Format(ItemLedgerEntry."Posting Date", 0, DocTemplateSetupEFTTSL."Date Format Text")) = 0 then
if ShipmentDateText = '' then
ShipmentDateText := Format(ItemLedgerEntry."Posting Date", 0, DocTemplateSetupEFTTSL."Date Format Text")
else
ShipmentDateText += ', ' + Format(ItemLedgerEntry."Posting Date");
until ValueEntry.Next() = 0;
end;

local procedure GetDocumentTemplateSetup()
begin
if GotTemplateSetup then
exit;
DocTemplateSetupEFTTSL.Get();
GotTemplateSetup := true;
end;
}

Defaulting Custom Fields

You can include the custom field configuration in your extension. This saves time when deploying the extension into different environments and configuring different companies. The App Id of your extension is assigned to records created by your extension.

  1. Subscribe to the OnBeforeGetCustomFieldDefaults event. This event gets fired when the extension gets installed and when you use the Initialise Default Fields action.
  2. Create a codeunit that specifies configuration settings
  3. Add code to the Install and Upgrade codeunits for your extension.

Subscribe to OnBeforeGetCustomFieldDefaults

codeunit 50000 "ThetaReportSubscriber_TSL"
{

[EventSubscriber(ObjectType::Table, Database::ThetaDocumentSetting_EFT_TSL, 'OnBeforeGetCustomFieldDefaults', '', false, false)]
local procedure OnBeforeGetCustomFieldDefaults(ReportID: Integer; var TempThetaDocCustomField: Record ThetaDocCustomField_EFT_TSL);
var
ThetaReportConfig: Codeunit ThetaReportConfig_TSL;
begin
ThetaReportConfig.GetCustomFieldDefaults(ReportID, TempThetaDocCustomField);
end;
}

Configuration Codeunit

This codeunit has functions that create the custom fields, table relations and other settings using Base Pack helper functions.

/// <summary>
/// Handles the document setting defaults and the custom fields that should be added/updated by default
/// </summary>
codeunit 50002 "ThetaReportConfig_TSL"
{
/// <summary>
/// Addes the custom fields that you want to use with your documents
/// </summary>
procedure GetCustomFieldDefaults(ReportID: Integer; var TempThetaDocCustomFieldEFTTSL: Record ThetaDocCustomField_EFT_TSL);
begin
case ReportID of
Report::SalesInvoice_EFT_TSL:
SalesDocumentReports(ReportID, TempThetaDocCustomFieldEFTTSL);
end;
end;
/// <summary>
/// Adds custom fields for all sales documents
/// </summary>
local procedure SalesDocumentReports(ReportID: Integer; var TempThetaDocCustomFieldEFTTSL: Record ThetaDocCustomField_EFT_TSL)
var
SalesLine: Record "Sales Line"; // can reference field numbers in sales line for all sales documents
ShipmentNosTxt: Label 'Shipment Nos', MaxLength = 250;
begin
// common fields for sales documents
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 1, 'Subsidiary Details', ValueType::Field, Database::"Company Information", CompanyInformation.FieldNo(Name), Link::Default,
SubsidiaryTxt, FormatType::None, '', false);
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 2, 'Quantity (Base) Caption', ValueType::"Field Caption", Database::"Sales Invoice Line", SalesLine.FieldNo("Quantity (Base)"), Link::Default, '',
FormatType::None, '', true);
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 3, 'Quantity (Base)', ValueType::Field, Database::"Sales Invoice Line", SalesLine.FieldNo("Quantity (Base)"), Link::Default, '',
FormatType::"AL Format String", '<Precision,0:5><Sign,1><Integer Thousand><Decimals>', true);

// fields for the sales invoice only
if ReportID = Report::SalesInvoice_EFT_TSL then begin
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 4, 'Tracking Nos Caption (if shipment has tracking no)', ValueType::"Custom AL Code", '', FormatType::None, '', false);
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 5, 'Tracking Nos for shipment(s)', ValueType::"Custom AL Code", '', FormatType::None, '', false);
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 6, 'Shipment Nos Caption', ValueType::Constant, ShipmentNosTxt, FormatType::None, '', false);
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 7, 'Shipment Nos', ValueType::"Custom AL Code", '', FormatType::None, '', false);
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 8, 'Total Number of Pieces', ValueType::"Custom AL Code", '', FormatType::"AL Format String", '<Precision,0:0><Sign,1><Integer Thousand><Decimals>', false);
TempThetaDocCustomFieldEFTTSL.AddCustomField(
ReportID, 9, 'Salesperson Name', ValueType::Field, Database::"Salesperson/Purchaser", SalespersonPurchaser.FieldNo(Name), Link::"Table Relation Code", '',
FormatType::None, '', false, 'SINV-SALESPERSON');
end;
end;

procedure InitThetaReportSettings()
var
ThetaDocumentSettingEFTTSL: Record ThetaDocumentSetting_EFT_TSL;
begin
ThetaDocumentSettingEFTTSL.InitialiseReportSettingsForStandardThetaDocuments();
end;

var
CompanyInformation: Record "Company Information";
ValueType: Enum ThetaDocFieldValueType_EFT_TSL;
Link: Enum DocFieldLinkType_EFT_TSL;
FormatType: Enum CustomFieldFormatType_EFT_TSL;
SubsidiaryTxt: Label '%1 is a subsidiary of Cronus International Ltd.', MaxLength = 250, Comment = '%1 = company name';
}

Install Codeunit

This code will cause the OnBeforeGetCustomFieldDefaults event to be fired during installation.

codeunit 50003 "InstallReportExt_TSL"
{
Subtype = Upgrade;

trigger OnInstallAppPerCompany()
var
ThetaReportConfig: Codeunit ThetaReportConfig_TSL;
begin
ThetaReportConfig.InitThetaReportSettings();
end;
}

Upgrade Codeunit

This code will cause the OnBeforeGetCustomFieldDefaults event to be fired when the extension is upgraded.

codeunit 50004 "UpgradeReportExt_TSL"
{
Subtype = Install;

trigger OnUpgradePerCompany()
var
ThetaReportConfig: Codeunit ThetaReportConfig_TSL;
begin
ThetaReportConfig.InitThetaReportSettings();
end;
}

Defaulting Table Relations

You can define table relations to use with your custom fields from the extension.

  1. Subscribe to the OnBeforeGetTableRelationDefaults event. This event gets fired when the extension gets installed and when you use the Initialise Default Fields action.
  2. Create a codeunit that specifies configuration settings (or use the same codeunit where you define the custom fields).
  3. Add code to the Install and Upgrade codeunits for your extension (unless you have already done this for custom fields).

Subscribe to OnBeforeGetTableRelationDefaults

codeunit 50000 "ThetaReportSubscriber_TSL"
{

[EventSubscriber(ObjectType::Table, Database::ThetaDocumentSetting_EFT_TSL, 'OnBeforeGetTableRelationDefaults', '', false, false)]
local procedure OnBeforeGetTableRelationDefaults(ReportID: Integer; var TableRelation: Record TableRelation_EFT_TSL);
var
ThetaReportConfig: Codeunit ThetaReportConfig_TSL;
begin
ThetaReportConfig.GetTableRelationDefaults(ReportID, TableRelation);
end;
}

Configuration Codeunit (Table Relations)

codeunit 50002 "ThetaReportConfig_TSL"
{
/// <summary>
/// Adds the table relations that are used with the custom fields
/// </summary>
/// <param name="ReportId"></param>
/// <param name="TableRelationEFT"></param>
procedure GetTableRelationDefaults(ReportId: Integer; var TableRelationEFT: Record TableRelation_EFT_TSL)
begin
case ReportID of
Report::SalesInvoice_EFT_TSL:
SalesDocumentTableRelations(ReportID, TableRelationEFT, 'SINV-');
end;
end;
/// <summary>
/// Adds table relations for sales documents
/// </summary>
/// <param name="ReportId"></param>
/// <param name="TableRelationEFT"></param>
/// <param name="Prefix"></param>
local procedure SalesDocumentTableRelations(ReportId: Integer; var TableRelationEFT: Record TableRelation_EFT_TSL; Prefix: Text[5])
var
SalesPersonLbl: Label 'Salesperson', MaxLength = 15;
begin
case ReportId of
Report::SalesInvoice_EFT_TSL:
TableRelationEFT.AddTableRelation(Prefix + SalesPersonLbl, SalesPersonLbl, ReportId, Database::"Salesperson/Purchaser", '1', 'Field', '112', '43');
end;
end;
}

Defaulting Document Settings

You can include document setting defaults in your extension. This saves time when deploying the extension into different environments and configuring different companies.

Subscribe to OnAfterGetOrInsertReportSettingsDuringInstallOrUpgrade

This event gets fired in the following scenarios:

  • When your extension is installed/upgraded.
  • When a new company is initialised.
  • When you select the Apply Default Settings action.
note

The event is fired after the record is inserted so you need to modify the record if you change it.

codeunit 50000 "ThetaReportSubscriber_TSL"
{
[EventSubscriber(ObjectType::Table, Database::ThetaDocumentSetting_EFT_TSL, 'OnAfterGetOrInsertReportSettingsDuringInstallOrUpgrade', '', false, false)]
local procedure OnAfterGetOrInsertReportSettingsDuringInstallOrUpgrade(var ThetaDocumentSetting: Record ThetaDocumentSetting_EFT_TSL);
var
ThetaReportConfig: Codeunit ThetaReportConfig_TSL;
begin
ThetaReportConfig.GetDocumentSettingDefaults(ThetaDocumentSetting);
end;
}

Configuration Codeunit

Add a function to handle the default settings. In the example below, we only default the Show Serial/Lot No. setting for two reports. However, you can update any of the fields on the document settings.

/// <summary>
/// Handles the document setting defaults and the custom fields that should be added/updated by default
/// </summary>
codeunit 50002 "ThetaReportConfig_TSL"
{
procedure GetDocumentSettingDefaults(var ThetaDocumentSettingEFT: Record ThetaDocumentSetting_EFT_TSL)
begin
case ThetaDocumentSettingEFT."Report ID" of
Report::SalesInvoice_EFT_TSL:
ThetaDocumentSettingEFT."Show Serial/Lot No." := true;
Report::SalesShipment_EFT_TSL:
ThetaDocumentSettingEFT."Show Serial/Lot No." := true;
else
exit;
end;
ThetaDocumentSettingEFT.Modify();
end;
}

Defaulting Custom Document Layout Selections

You can include document layout selection defaults in your extension. This saves time when deploying the extension into different environments and configuring different companies.

Subscribe to OnBeforeGetCustLayoutDefaults

This event gets fired in the following scenarios:

  • When your extension is installed/upgraded.
  • When a new company is initialised.
  • When you select the Apply Default Settings action.
codeunit 50000 "ThetaReportSubscriber_TSL"
{
[EventSubscriber(ObjectType::Table, Database::ThetaDocumentSetting_EFT_TSL, 'OnBeforeGetCustLayoutDefaults', '', false, false)]
local procedure OnBeforeGetCustLayoutDefaults(var TempReportLayoutBuffer: Record ReportLayoutBuffer_EFT_TSL temporary; ReportID: Integer);
var
ThetaReportConfig: Codeunit ThetaReportConfig_TSL;
begin
ThetaReportConfig.SetCustomLayoutDefaults(TempReportLayoutBuffer, ReportID);
end;
}

Configuration Codeunit

Add a function to handle the default layout selections. In the example below, we only default the layout for the sales invoice.

/// <summary>
/// Handles the document setting defaults and the custom fields that should be added/updated by default
/// </summary>
codeunit 50002 "ThetaReportConfig_TSL"
{
internal procedure SetCustomLayoutDefaults(var TempReportLayoutBufferEFT: Record ReportLayoutBuffer_EFT_TSL temporary; ReportID: Integer)
begin
case ReportID of
Report::SalesInvoice_EFT_TSL:
TempReportLayoutBufferEFT.AddLayout(ReportID, '', 'SalesInvoiceBasePackDemo'); // passing '' for companyname means it is used in all companies
end;
end;
}
tip

You only specify the company parameter if you have different layouts in different companies. If several companies use the same layout, but not all, you can pass the company names as a comma-separated string. This string is NOT case-sensitive.

Adding Barcodes to Reports

info

This section assumes you have enabled the barcode for the report on the Document Settings for the report.

To add a barcode to a report layout, you can follow these steps:

  1. Search for custom report layouts, then click on new.

Custom Report Layouts

  1. Enter the report ID you want to print the barcode and click on Insert RDLC Layout.

Insert Built-in Page

  1. A new custom layout is now available in the list.

New Custom Layout

  1. Navigate to the layouts section to manage your report layouts. Find the newly created layout and choose to export it.

Export Layout

  1. Open the exported RDLC layout file in your report design tool or Microsoft Report Builder.

RDLC Layout

  1. Identify the position where you want to place the barcode in the layout and insert a textbox or image at that location.

  2. Right-click on the inserted textbox or image, go to Expression, and write the expression to retrieve the barcode's encoded text or image from the dataset. The expression should reflect the data you want to encode.

    Expression for Encoded Text : =Cstr(Choose(1, Split(Cs(ReportItems!BarcodeValue),Chr(177))))

Encoded Text Expression

Expression for Barcode Image : =Convert.FromBase64String(Code.GetBarcodeImage)

Encoded Text Expression

  1. Go to the text box properties, find the font settings, and click on the font property. Write an expression that specifies the font for the barcode.

    Expression for Barcode Font : =Cstr(Choose(2, Split(Cstr(ReportItems!Barcode.Value),Chr(177))))

Barcode Font Expression

No font is required for Barcode Image.
  1. Save your changes to the RDLC layout file.

  2. Import the modified layout into the custom report layout, ensuring you associate it with the correct one.

Import Report Page

  1. During the import process, choose the barcode type you want to use to generate the barcode. Specify the settings and parameters according to your requirements.

  2. Run the report in preview mode or by exporting it to a suitable format. Verify that the barcode is displayed correctly and can be scanned using a scanner or app.

  3. These are some examples:

code 128 Standard

QR Code Standard

QR Code Image Standard

Report Extensions

As mentioned above, you should avoid adding fields to the datasets using report extensions. However, there are good cases to use report extensions. This report extension uses the rendering section to publish the custom layout. This is a recommended approach because you only have to specify the layout once and you do not need to work with custom layouts in Business Central.


reportextension 50000 "SalesInvoice_TSL" extends SalesInvoice_EFT_TSL
{
dataset
{
}
rendering
{

Layout(SalesInvoiceBasePackDemo)
{
Caption = 'Custom Sales Invoice Layout with Package Tracking';
LayoutFile = 'src/Layouts/CustomDocuments/SalesDocument.rdl';
Type = RDLC;
}

}
}

caution

The report extension object also allows you to use the RDLCLayout property to specify the custom layout. While this does give you the benefit of not having to specify the layout in production it, it replaces the default layout and you cannot use this in a different company. Using the rendering section also allows you to specify more than one layout when an organisation has this requirement.

Selecting your custom layout

You need to select the report layout the first time you deploy your extension to an environment. For each subsequent deployment you do not need to report this step unless to change the name of the report layout selection. The example below selects the custom report layout for all companies.

  1. Open the Report Layout Selection page. You will notice that we have removed the company name because we want to use this layout in all companies.

Report Layout Selection

  1. Select your custom report layout and click OK.

Select Layout

Events for extending reports

ObjectEventPurpose
Most Theta DocumentsOnBeforeInsertingFreeLinesNeededThis event fires before additional lines get added to the dataset to push the footer to the bottom of the page. Use this event to add additional lines, perform different grouping or sorting, etc.
Most Theta DocumentsOnBeforeCopyDocumentLineToDocLineBufferThis event fires before a line gets copied to the report dataset.
Most Theta DocumentsOnAfterCopyDocumentLineToDocLineBuffer(This event fires after a line gets copied to the report dataset.
Several Theta DocumentsOnBeforeAddingTrackingLinesThis event fires before creating the lines that show item tracking details.
table "ThetaDocumentSetting_EFT_TSL"OnAfterGetOrInsertReportSettingsDuringInstallOrUpgradeUse this event to handle your custom field defaults - this event only fires during the installation or upgrade of the Base Pack extension.
table "ThetaDocumentSetting_EFT_TSL"OnBeforeFinishInitConfigurableSystemFieldsThis event fires after the default document settings have been initialised.
table "ThetaDocumentSetting_EFT_TSL"OnBeforeGetTableRelationDefaultsAdd default table relations that you want to use with your custom fields.
table "ThetaDocumentSetting_EFT_TSL"OnBeforeGetCustomFieldDefaultsAdd default values to your custom fields so you don't have to manage this with configuration packages.
table "ThetaDocumentSetting_EFT_TSL"OnBeforeAssignRecordRefUse this event when you want to handle the assignment of a custom field instead of performing the default logic.
table "ThetaDocumentSetting_EFT_TSL"OnBeforeFormatFieldAllows you to handle the formatting of a custom field.
table "ThetaDocumentSetting_EFT_TSL"OnBeforeGetTextValueForCustomTextWithDocLineBufferThis event fires before the app handles the processing for a custom field. Use this event if you need AL Code to assign the custom value (e.g. for running totals).
table "ThetaDocumentSetting_EFT_TSL"OnBeforeOutputDocumentLinesThis event fires after the lines have been added to the report dataset directly before they get outputted. You can use this event to initialise a single instance codeunit related to the report processing.
table "ThetaDocumentSetting_EFT_TSL"OnAfterOutputDocumentLinesThis event fires after the lines have been output.
table "ThetaDocumentSetting_EFT_TSL"OnBeforeGenerateDocumentBarCodeYou can use this event to handle your custom barcode.
table "ThetaDocumentSetting_EFT_TSL"OnAfterInitialiseReportSettingsForStandardThetaDocumentsInitialise settings for custom documents that use the Theta Document patterns.
table "ThetaDocumentSetting_EFT_TSL"OnAfterGetReportSettingsThese event fires after the settings have been retrieved for a document.