Hi All,
I am new to this, so please bear with me if I have not mentioned all the information needed to get proper help. I have built a table extension that adds two custom fields to the company information table in business central. Then I added these field to a page through the page extension. The last step for me would be to add these fields to the report dataset of the sales Invoice report 1306. My work so far has the added fields present in the report dataset. The only problem seems to be that the fields, which do have a value, do not show the value.
Important Notes on what I have already looked at:
I have seen that report 1306 uses a procedure on the report Init() trigger.
CompanyInfo.Get()

Furthermore, any fields in the header are being populated by a procedure. The table header has been split into two dataItems (LeftHeader & RightHeader). I am guessing I have to subscribe to the right trigger to add my two custom fields being populated. I however, cannot seem to figure out what trigger or triggers I need to use to add my two custom fields.

This goes back to the FillLeftHeader() Procedure

The code I wrote is below:
Table Extension
tableextension 50100 CribNoExt extends "Company Information"
{
fields
{
// Add changes to table fields here
field(101; Company_Crib_No; Text[20])
{
Caption = 'Crib No.';
}
field(102; Company_Kvk_No; Text[20])
{
Caption = 'Kvk No.';
}
field(103; "Bank Name 2"; Text[20])
{
Caption = 'Bank Name 2';
}
field(104; "Bank Account No 2"; Text[20])
{
Caption = 'Bank Account No 2';
}
}
var
myInt: Integer;
}
Page extension:
pageextension 50102 CribNoPage extends "Company Information"
{
layout
{
// Add changes to page layout here
addafter("Industrial Classification")
{
field(CribNo; Rec.Company_Crib_No)
{
ApplicationArea = all;
}
field(KvkNo; Rec.Company_Kvk_No)
{
ApplicationArea = all;
}
}
addafter("Bank Account No.")
{
field("Bank Name 2"; Rec."Bank Name 2")
{
ApplicationArea = all;
}
field("Bank Account No 2"; Rec."Bank Account No 2")
{
ApplicationArea = all;
}
}
}
actions
{
// Add changes to page actions here
}
var
myInt: Integer;
}
Report Extension:
reportextension 50103 CribNoKvK extends "Standard Sales - Invoice"
{
dataset
{
// Add changes to dataitems and columns here
add(Header)
{
column(Company_Crib_No; companyInfoExt.Company_Crib_No) { }
column(Company_Kvk_No; companyInfoExt.Company_Kvk_No) { }
}
}
Var
myInt: Integer;
myCribNo: text[20];
companyInfoExt: Record "Company Information";
company_crib_no_lbl: Label 'Crib No';
company_kvk_no_lbl: Label 'Kvk No';
}
IN conclusion I want to know is this possible? and if not is the only other solution to create a completely new report? This is quite a complex report to just copy and then edit. I would rather extend it.