Simple dialog page to input a number.

thomast
Member Posts: 102
Hi Guys,
Does anyone know how to make a very simple dialog box where the user can input a number and click OK?
I'm looking for something like the STRMENU function but where the user can input a number into a field - the value should then be brought back to the process which envoked it. Maybe it is possible to make a page which does not sit on top of a source table?
Thanks
Does anyone know how to make a very simple dialog box where the user can input a number and click OK?
I'm looking for something like the STRMENU function but where the user can input a number into a field - the value should then be brought back to the process which envoked it. Maybe it is possible to make a page which does not sit on top of a source table?
Thanks

0
Answers
-
Dialog.Input(value);0
-
Create a page of type "ConfirmationDialog". Then create a variable to handle your input and place that as a field on the page.
Create a public function on the page that returns the variable used in your input field.
Something like this can then be done from C/AL:
Page:OBJECT Page 50000 ConfirmDialog { OBJECT-PROPERTIES { Date=24-11-15; Time=09:29:52; Modified=Yes; Version List=; } PROPERTIES { PageType=ConfirmationDialog; } CONTROLS { { 1160040000;;Container; Name=Testing input; ContainerType=ContentArea } { 1160040001;1;Field ; CaptionML=ENU=Enter a number between 1 and 100; SourceExpr=NumberToEnter } } CODE { VAR NumberToEnter@1160040000 : Integer; PROCEDURE ReturnEnteredNumber@1160040000() : Integer; BEGIN EXIT(NumberToEnter); END; BEGIN END. } }
CodeunitOBJECT Codeunit 50000 Test Dialog { OBJECT-PROPERTIES { Date=24-11-15; Time=09:34:10; Modified=Yes; Version List=; } PROPERTIES { OnRun=BEGIN ConfirmDialog.LOOKUPMODE(TRUE); IF ConfirmDialog.RUNMODAL = ACTION::Yes THEN MESSAGE(FORMAT(ConfirmDialog.ReturnEnteredNumber)); END; } CODE { VAR ConfirmDialog@1160040000 : Page 50000; BEGIN END. } }
0 -
mdPartnerNL wrote: »Dialog.Input(value);
Won't work in RTC. Input is deprecated.0 -
Hi Guys - the answer is to use a dotnet variable as described here:
http://saurav-nav.blogspot.co.id/2014/09/discontinued-component-nav-2013-later.html0 -
Sry. In my book that is certainly not the answer. You may find that to be the best choice in your particular scenario but a better way (IMO ofc) is absolutely to use either a confirmationdialog type page or even better probably a pagetype::StandardDialog. StandardDialog page will give you and OK/CANCEL button and from a page you can do database interaction and all the regular stuff that NAV lets you do. You can't do that using a dotnet variable.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions