Input Dialog

mfabian
Member Posts: 187
You need the user enters some parameters but you don't want to create a form for it:
Let's ask for three dates within our codeunit:
Var
window : Dialog;
BookingDate : Date;
DocumentDate : Date;
DeliveryDate : Date;
EntryNo : Integer;
NewEntryNo : Integer;
Window.open ('Booking Date #1#########\'+
'Dok. Date #2#########\'+
'Shipment Date #3#########',
BookingDate,DocumentDate,DeliveryDate);
EntryNo := 0;
NewEntryNo := 1;
While (NewEntryNo > 0) and (EntryNo <> NewEntryNo) do begin
EntryNo := NewEntryNo;
Case EntryNo of
1 : NewEntryNo := Window.input(1,BookingDate);
2 : NewEntryNo := Window.input(2,DocimentDate);
3 : NewEntryNo := Window.input(3,DeliveryDate);
end;
end;
window.close;
if NewEntryNo = 0 then
Exit;
.. continue code ...
Explanation: This routine allows the user to use the up/down- arrows and (Shift-)Tab to move between the field.
Function window.input returns the number of the next Entry Field if the user uses an arrow or tab. It returns 0 if the user presses ESC and the same fieldnumber if the user presses ENTER.
Marcus Fabian
m.fabian@thenet.ch
+41 79 439 78 72
Let's ask for three dates within our codeunit:
Var
window : Dialog;
BookingDate : Date;
DocumentDate : Date;
DeliveryDate : Date;
EntryNo : Integer;
NewEntryNo : Integer;
Window.open ('Booking Date #1#########\'+
'Dok. Date #2#########\'+
'Shipment Date #3#########',
BookingDate,DocumentDate,DeliveryDate);
EntryNo := 0;
NewEntryNo := 1;
While (NewEntryNo > 0) and (EntryNo <> NewEntryNo) do begin
EntryNo := NewEntryNo;
Case EntryNo of
1 : NewEntryNo := Window.input(1,BookingDate);
2 : NewEntryNo := Window.input(2,DocimentDate);
3 : NewEntryNo := Window.input(3,DeliveryDate);
end;
end;
window.close;
if NewEntryNo = 0 then
Exit;
.. continue code ...
Explanation: This routine allows the user to use the up/down- arrows and (Shift-)Tab to move between the field.
Function window.input returns the number of the next Entry Field if the user uses an arrow or tab. It returns 0 if the user presses ESC and the same fieldnumber if the user presses ENTER.
Marcus Fabian
m.fabian@thenet.ch
+41 79 439 78 72
With best regards from Switzerland
Marcus Fabian
Marcus Fabian
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
- 320 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