Deactivate ESC Key in a form
RI0207
Member Posts: 17
Hi All
How to deactivate ESC Key at a Form. There's some checking on the credit Limit in this form once the user Press OK.. But users can bypass this checking by Pressing ESC Key/ by close (X) the form which i should not allow... How to deactivate ESC key in the form
Awaits the reply...
How to deactivate ESC Key at a Form. There's some checking on the credit Limit in this form once the user Press OK.. But users can bypass this checking by Pressing ESC Key/ by close (X) the form which i should not allow... How to deactivate ESC key in the form
Awaits the reply...
0
Answers
-
There are two ways if found, so fast as i can, in my brain.
first: call the the Form in Lookupmode from other form like thisBoolVariable := false; while not BoolVar do begin BoolVar := form.runmodal(62034) = Action::LookupOK; end;
Other way is programming in the Form "YourFormIdOrName" self.Name DataType Subtype Length VarAction Action Form - OnOpenForm() clear(VarAction); Form - OnQueryCloseForm() : Boolean if (CurrForm.LOOKUPMODE = CurrForm.LOOKUPMODE::YES) then begin if (VarAction = ACTION::LookupOK) then //or (VarAction = ACTION::LookupCancel) then EXIT(true); end; message('You must press OK); // or Cancel'); exit(false); //behind OK Button <Control12> - OnPush() VarAction := ACTION::LookupOK; //behind Cancel button <Control13> - OnPush() VarAction := ACTION::LookupCancel;
BUT NOTE:
ESC IS LIKE LOOKUPCANCEL :!:
RegardsDo you make it right, it works too!0 -
Use Form - OnQueryCloseForm() : Boolean.
But be careful. If you don't create at least one exit condition, you won't be able to exit the form and NAV. You'll have to exit NAV by terminating the process."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
Thanks a LOT Garak....It did works for me with very minor modifications.
I couldn't compile my form (it was closing, asking want to send error report etc) after i put your coding as it is...then i made some small changes as per below and got what i want...
IF (Vact = ACTION::LookupOK) THEN
EXIT(TRUE) ELSE
BEGIN
MESSAGE('You must press OK');
EXIT(FALSE);
END;
I took out the
IF(CurrForm.LOOKUPMODE = CurrForm.LOOKUPMODE::YES) , other parts all reamin same...
Thanks a million... =D>0 -
Please, you're welcome.Do you make it right, it works too!0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions