web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Issue using RunModal

(0) ShareShare
ReportReport
Posted on by 10

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?

  • Suggested answer
    Renni Profile Picture
    960 on at

    Hello

    Here is a great blog post check some of this detail and see if it helps as it seems to point to a performance issue from what you describe

    demiliani.com/.../

  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    Instead of using DiscountDialog.RunModal() = ACTION::OK

    Try

    DiscountDialog.RunModal() = ACTION::LookupOK

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 671 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 434 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 241 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans