Hello!
I am new in BusinessCentral, I am learning the exnension developement in VSCode and i just had the issue regarding RunModal function.
I tried to create an input dialog box with one field, I added the new page with type StandardDialog (code is below)
page 61350 DiscountAmountInput
{
PageType = StandardDialog;
layout
{
area(Content)
{
field(Name; NumToEnter)
{
ApplicationArea = All;
Caption = 'Enter a discount amount';
Editable = true;
}
}
}
var
NumToEnter: Integer;
PROCEDURE ReturnEnteredNumber(): Integer;
BEGIN
EXIT(NumToEnter);
END;
}
I run this page from anothr page - I created an Action and added such code at OnAction trigger:
trigger OnAction();
var
DiscountDialog: Page DiscountAmountInput;
begin
IF DiscountDialog.RunModal() = ACTION::OK THEN begin
(.......)
end;
end;
But i got an issue - this modal window shows correctly but when I press OK button, the entire application freezing, it is not reacting to mouse clicking and keyboard and i have to close it by task manager. It is not depends of code after RunModal. I made some experiments and anytime when i using RunModal for this page I got this freezing. At the same time, page.RunModal(page::DiscountAmountInput) and DiscountAmount.Run() works correctly/
Do you have any ideas what is the reason?