1

Suppose I want to write a simple addition program using C/AL in NAV 2016. How can I dynamically ask user to enter the two numbers?

In Microsoft Dynamics AX we use "dialog" class for this purpose.

I need some code reference or the description to approach such process.

2 Answers2

0

In Dynamics NAV do not have something like Dynamics AX dialog class.

In this case you need create a page with your fields to user complete the info. Then in other page call this new page to open it and the user can complete de info or add in MenuSuite to access.

Example:

Page 88000 Calculator enter image description here

Variables

enter image description here

Action and Action code enter image description here enter image description here

Page running

enter image description here

Then you can create a menuSuite for this page or write this code in other page to open it

PAGE.RUNMODAL(88000);
Jonathan Bravetti
  • 2,228
  • 2
  • 15
  • 29
  • If it is available in your NAV version, I would suggest that you use StandardDialog as the PageType for your page. It's ideal for data entry (has an OK/Cancel button by default) and is less cluttered (no ribbon, factboxes etc.) than e.g. PageType Card. – Jan Hoek Sep 06 '19 at 07:36
  • Good observation Jan, can change this property in page properties (PageType) – Jonathan Bravetti Sep 06 '19 at 12:08
0

You can use

  1. Page object as described in other answer. But to get values from it to calling function you would need to create source table for that page. Or throw some function to it like GetValues.
  2. Use dialog.input. It may be obsolete though.
  3. Use dialog class from windows .net library. Will not work in web client though.
  4. Depending on situation report’s request page might be a good option.

To help you better please describe the requirement you stumbled upon.

Mak Sim
  • 2,148
  • 19
  • 30