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.
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!
Comments
Ask them to just hit ENTER if they don't want to enter anything.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Cheers, and thanks for your reply! =D>
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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
Michael
If you htt ESC. the message will not execute.
I looked at documentation and it states that it will terminate.
So looks like it's working as suppose to.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I am still interested in the example where it closes the whole client?
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.
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.0
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.
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 Esc
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"...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.