I'm using docker with image 'mcr.microsoft.com/businesscentral/onprem:15.4.41023.41345-dk-ltsc2019'
I have a problem when using repeaters, which have condional editable, in a FastTab.
I have the following code
table 50100 "TRS Booking"
{
DataClassification = CustomerContent;
fields
{
field(1; "No."; Code[20])
{
Caption = 'No.';
DataClassification = CustomerContent;
}
field(2; "State"; Enum "TRS Booking State")
{
Caption = 'State';
DataClassification = CustomerContent;
}
}
keys
{
key(PK; "No.")
{
Clustered = true;
}
}
trigger OnInsert()
begin
end;
trigger OnModify()
begin
end;
trigger OnDelete()
begin
end;
trigger OnRename()
begin
end;
}
table 50101 "TRS Cargo Line"
{
DataClassification = CustomerContent;
fields
{
field(1; "Booking No."; Code[20])
{
Caption = 'Booking No.';
DataClassification = CustomerContent;
}
field(2; "Line No."; Integer)
{
Caption = 'Line No.';
DataClassification = CustomerContent;
}
field(22; "State"; Enum "TRS Booking State")
{
Caption = 'State';
DataClassification = CustomerContent;
Editable = false;
}
}
keys
{
key(PK; "Booking No.", "Line No.")
{
Clustered = true;
}
key(FK1; "Booking No.")
{
}
}
trigger OnInsert()
begin
end;
trigger OnModify()
begin
end;
trigger OnDelete()
begin
end;
trigger OnRename()
begin
end;
}
enum 50100 "TRS Booking State"
{
Extensible = true;
// Booking and price lines is open for editing
value(0; Open)
{
Caption = 'Open';
}
// Booking and price lines has been approve and are ready for transfer
value(10; Approve)
{
Caption = 'Approve';
}
// Booking has been transferred
value(20; Close)
{
Caption = 'Close';
}
}
page 50100 "TRS Booking"
{
Caption = 'Booking';
PageType = Card;
UsageCategory = None;
SourceTable = "TRS Booking";
layout
{
area(Content)
{
group("TRS General")
{
Caption = 'TRS General';
Editable = State = State::Open;
field("No."; "No.")
{
ApplicationArea = All;
Editable = true;
Importance = Promoted;
}
field("State"; "State")
{
ApplicationArea = All;
Editable = false;
}
}
group("TRS Cargo")
{
Caption = 'TRS Cargo';
group("TRS Cargo 1.2")
{
ShowCaption = false;
part("TRS Cargo Lines"; "TRS Cargo Lines")
{
ApplicationArea = All;
ShowFilter = false;
SubPageLink = "Booking No." = field("No.");
}
}
}
}
}
actions
{
area(Processing)
{
action("TRS Approve Booking")
{
Caption = 'TRS Approve Booking';
ApplicationArea = All;
Image = Close;
Enabled = State = State::Open;
trigger OnAction()
begin
"Booking Mgt.".ApproveBooking(Rec);
end;
}
action("TRS UnApprove Booking")
{
Caption = 'TRS UnApprove Booking';
ApplicationArea = All;
Image = Close;
Enabled = State = State::Approve;
trigger OnAction()
begin
"Booking Mgt.".UnApproveBooking(Rec);
end;
}
}
}
trigger OnInsertRecord(BelowxRec: Boolean): Boolean
var
"Cargo Line": Record "TRS Cargo Line";
begin
"Cargo Line".Init();
"Cargo Line"."Booking No." := "No.";
"Cargo Line"."Line No." := 10000;
"Cargo Line".Insert();
end;
var
"Booking Mgt.": Codeunit "TRS Booking Manager";
"Is Editable": Boolean;
}
page 50102 "TRS Cargo Lines"
{
Caption = 'Cargo Lines';
PageType = ListPart;
ApplicationArea = All;
UsageCategory = Administration;
SourceTable = "TRS Cargo Line";
AutoSplitKey = true;
layout
{
area(Content)
{
repeater(General)
{
Editable = State = State::Open;
field("Booking No."; "Booking No.")
{
ApplicationArea = All;
Visible = false;
Editable = false;
}
field("Line No."; "Line No.")
{
ApplicationArea = All;
}
field(State; State)
{
ApplicationArea = All;
Editable = false;
}
}
}
}
}
codeunit 50100 "TRS Booking Manager"
{
internal procedure ApproveBooking(var Booking: Record "TRS Booking")
var
"Cargo Line": Record "TRS Cargo Line";
begin
if (Booking.State = Booking.State::Open) then begin
"Cargo Line".SetFilter("Booking No.", '=%1', Booking."No.");
if "Cargo Line".FindSet() then
repeat
// change state on cargo line
"Cargo Line".State := "Cargo Line".State::Approve;
"Cargo Line".Modify();
until "Cargo Line".Next() = 0;
Booking.State := Booking.State::Approve;
end;
end;
internal procedure UnApproveBooking(var Booking: Record "TRS Booking")
var
"Cargo Line": Record "TRS Cargo Line";
begin
if (Booking.State = Booking.State::Approve) then begin
"Cargo Line".SetFilter("Booking No.", '=%1', Booking."No.");
if "Cargo Line".FindSet() then
"Cargo Line".ModifyAll(State, "Cargo Line".State::Open);
Booking.State := Booking.State::Open;
end;
end;
}
When I open my booking card page and click the approve or unapprove button.
If the FastTab is open when I open the page everything works correct, but if the FastTab is closed then I get this error in the browser.
{"jsonrpc":"2.0","method":"LOGERROR","params":[{"clientInfo":{"platform":"Win32","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363","browserLanguage":"da-DK"},"message":"Unable to get property 'get_element' of undefined or null reference","pageUrl":"http://mod/BC/?page=50100&company=CRONUS Danmark&dc=0&runinframe=1","originalError":{},"detailedMessage":" at DN.RepeaterControlAdapter.prototype.onEditableChanged (http://mod/BC/js/framework.js?h=B41614F65C2534E8B7D1DE86F184576FE96CAD639A808C61E420659EBBE72E30&_v=15.0.40939.41271:5576:3953)\r\n at DN.LogicalControlAdapter.prototype.onLogicalControlPropertyChanged (http://mod/BC/js/framework.js?h=B41614F65C2534E8B7D1DE86F184576FE96CAD639A808C61E420659EBBE72E30&_v=15.0.40939.41271:5138:1187)\r\n at Type.prototype.callBaseMethod (http://mod/BC/js/mscorlib.js?h=CF4DC817097681759C949D3A168AB341FB735B938B5B4DD71259BE085DD88E42&_v=15.0.40939.41271:1:23528)\r\n at DN.RepeaterControlAdapter.prototype.onLogicalControlPropertyChanged (http://mod/BC/js/framework.js?h=B41614F65C2534E8B7D1DE86F184576FE96CAD639A808C61E420659EBBE72E30&_v=15.0.40939.41271:5574:3102)\r\n at DN.LogicalControlAdapter.prototype.$28 (http://mod/BC/js/framework.js?h=B41614F65C2534E8B7D1DE86F184576FE96CAD639A808C61E420659EBBE72E30&_v=15.0.40939.41271:5138:667)\r\n at b (http://mod/BC/js/mscorlib.js?h=CF4DC817097681759C949D3A168AB341FB735B938B5B4DD71259BE085DD88E42&_v=15.0.40939.41271:1:26048)\r\n at Anonymous function (http://mod/BC/js/logicalclientdll.js?h=9A867ED61E4F818CA05EFE74E144AF4AA820C2814E2BB2573EBFCA50F18D3492&_v=15.0.40939.41271:16:53472)\r\n at Array.prototype.forEach (native code)\r\n at e.prototype.emit (http://mod/BC/js/logicalclientdll.js?h=9A867ED61E4F818CA05EFE74E144AF4AA820C2814E2BB2573EBFCA50F18D3492&_v=15.0.40939.41271:16:53378)\r\n at e.prototype.flushScope (http://mod/BC/js/logicalclientdll.js?h=9A867ED61E4F818CA05EFE74E144AF4AA820C2814E2BB2573EBFCA50F18D3492&_v=15.0.40939.41271:16:142886)\r\n","silent":true}],"id":1}
And my card window "freezes", which means I can not close the window. I have to close the browser.