Input Dialog

mfabianmfabian SwitzerlandMember Posts: 187
edited 2000-07-29 in NAV Tips & Tricks
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
[email protected]
+41 79 439 78 72
With best regards from Switzerland

Marcus Fabian
Sign In or Register to comment.