Business Central

Tuesday 25 August 2015

Major Differences between Run and RunModal function

I have browsed through lots of blogs and I nowhere found the proper example on how to use RUNMODAL Function. So, I taught of writing this blog so that it might be useful other NAV Developers.

RUN Function :


  • The page is opened and you can still go back to what you were doing on previous page.
  • We can switch to other page which is shown.

RUNMODAL Function:

  • The page is opened and you cannot go back to previous page until MODAL Page is closed.
  • We cannot switch to any other page until current page is closed.


Example :

Scenario :

Assume I want to filter a Customer table who has balance between 10,000 to 1,00000 and to display the filtered values in the Customer list page. You can do the following in the coding part.


Customer.CALCFIELDS(Balance);//Calculates flowfield values
Customer.SETRANGE(Balance,10000,100000);//apply filter range
IF Customer.FINDSET THEN
    PAGE.RUNMODAL(PAGE :: "Customer List",Customer);//opens the filtered list.




Fig. above shows only the filtered customers based on balance between 10,000 to 1,0000 range.

1 comment: