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?

I have the same question (0)
  • 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,269 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,949 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,064 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 559 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans