Nav 5.0 dialog bug?
 
            
                
                    Nagi                
                
                    Member Posts: 151                
            
                        
            
                    Hi,
Is there a bug in Nav 5.0 that causes the entire program to exit when a user enters ESC in a dialog popup?
I have a variable PopUp of type Dialog that prompts the user to enter an organization no. (custom field) on the customer, if the customer doesn't have one entered already. Nav terminates if the user hits ESC.
I have tried handling a possible return of zero in my code, but the effect is still the same. Am I doing something wrong or is this a bug in Nav 5.0?
In advance, thanks for any feedback.
Cheers!
                Is there a bug in Nav 5.0 that causes the entire program to exit when a user enters ESC in a dialog popup?
I have a variable PopUp of type Dialog that prompts the user to enter an organization no. (custom field) on the customer, if the customer doesn't have one entered already. Nav terminates if the user hits ESC.
I have tried handling a possible return of zero in my code, but the effect is still the same. Am I doing something wrong or is this a bug in Nav 5.0?
In advance, thanks for any feedback.
IF "Organization No." = '' THEN BEGIN
  PopUp.OPEN(STRSUBSTNO(Text101,FIELDCAPTION("Organization No."),"No.") + '\' +
             '#1#######################');
  IF PopUp.INPUT(1,OrgNo) = 0 THEN
    EXIT;
  PopUp.CLOSE;
  VALIDATE("Organization No.",OrgNo);
END;
Cheers!
0                
            Comments
- 
            Navision terminates if you hit ESC. That's how it works in 4.0 and 5.0.
 Ask them to just hit ENTER if they don't want to enter anything.0
- 
            So then it's a bug. In the C/SIDE reference guide it says that when "the user presses ESC to leave the window, the window will close and the calling C/AL code will terminate, and zero is returned." Weird though, that this fault has survived from 4.0 all the way up to 5.0, when it should be quite easy to spot.
 Cheers, and thanks for your reply! =D>0
- 
            I'd call it a feature. 0 0
- 
            I heard weird things about Dialog input that I never used this possibility. I am using some special form or report to get the data from user.0
- 
            Hi Nagi
 When you press ESC in a dialog it should return zero - not terminate.
 You wrote that the entire program exits when you press Esc in a dialog - but I am not able to reproduce that. Can you give me more context?
 Regards
 MichaelThis posting is provided "AS IS" with no warranties, and confers no rights.0
- 
            Here is an example.PopUp.OPEN('Please Enter value #1#######################'); if PopUp.INPUT(1,value) = 0 then PopUp.CLOSE; message(value);If you htt ESC. the message will not execute.
 I looked at documentation and it states that it will terminate.If the user presses Esc to leave the window, the window will close and the calling C/AL code will terminate, and zero is returned.
 So looks like it's working as suppose to.0
- 
            I just looked in the source code and you are right. But it is a bug (even though it is documentet). The C/AL Dialog subsystem checks for Esc and should return zero - but the underlying formsubsystem terminates for some reason.
 I am still interested in the example where it closes the whole client?This posting is provided "AS IS" with no warranties, and confers no rights.0
- 
            Hi Michael,
 The full scenario is like this:
 I have a function called PromptOrgNo with the code mentioned in the initial post. PopUp is a variable type dialog. Text101 reads 'Define %1 for customer %2'. OrgNo is a local variable type text 20. Organization No. is a custom field type text 20. The function is called in the OnValidate trigger of the Name field in the customer table.
 The popup window asks the user to enter an organization no. for the customer after the name is validated, and if user hits ESC instead of pressing cancel it will terminate NAV.0
- 
            offtopic, that's realy bad way to program.
 You don't want to ask for something in the middle of a transaction.
 In regards to crashing the finsql.exe 5.0 crashes when you hibernate the computer. It doesn't do it in 4.0my 2 cents0
- 
            
 You have one advantage compared to us NAV developers: you can look in the source code of fin.exe ;-)"Michael wrote:"]I just looked in the source code and you are right.
 Thank you for your participation in this forum. Good to see Navision employee No. 5 is still active with NAV ... and has found the way to communities.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
- 
            Hi guys
 I can't reproduce, or I'm looking in wrong direction.
 ...
 PopUp.OPEN('Please Enter value #1#######################');
 if PopUp.INPUT(1,value) = 0 then
 PopUp.CLOSE;
 message(value);
 ...
 1.Message never comes up - Esc or Cancel I push.
 2.Nav never closes - there are no differencies between Cancel or EscGB0
- 
            Hello Gedas,
 may be that difference is that you are trying it from table C/AL code and Nagi from Form C/Al code? But it is just a "may be"...0
- 
            I am not able to reproduce the Dialog.INPUT crash - but as NavStudent points out finsql.exe crashed when you hibernate the computer. This bug was fixed in 4.0 SP1 - but apparently it is back in 5.0 and will be fixed for SP1This posting is provided "AS IS" with no warranties, and confers no rights.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
- 323 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


![Michael_Nielsen_[MSFT]](https://w6.vanillicon.com/6fa5592fde3f0495532315c1cb01b255_100.png)


