Closing a form

xrivo
Member Posts: 56
Hi
We have a customer that ask for a form to be displayed in background always (users can't close it). I used OnQueryCloseForm trigger and it's ok, but the problem is when I try to close Navision, it won't close.
I've tried to close the form from function LoginEnd from codeunit 1 but doesn't work.
Thx for any help
We have a customer that ask for a form to be displayed in background always (users can't close it). I used OnQueryCloseForm trigger and it's ok, but the problem is when I try to close Navision, it won't close.
I've tried to close the form from function LoginEnd from codeunit 1 but doesn't work.
Thx for any help
0
Comments
-
Hi xrivo.
I guess you could do that. I don't know though how you start the form, important for my solution is that a global variable holds the form as long as the session is active.
Form code:Form - OnQueryCloseForm() : Boolean EXIT(OK2Exit); FUNCTION DoExit() OK2Exit := TRUE; //Global variable in the form CLOSE;
Codeunit:FUNCTION LoginStart() My4EverForm.RUN(); //Global variable for the Form FUNCTION LoginEnd() My4EverForm.DoExit();
This is non-tested code, but I think my intentions are clear enoughIt is impossible to make anything foolproof, because fools are so ingenious.0 -
I have tried this but doesn't work..because Navision try to run OnQueryCloseForm before LoginEnd.
Thx0 -
Hi.
Ok. I tested the solution I wrote, so I see what you mean. You can't tell the user to close the Main Menu before closing Navision I suppose (LoginStart and LoginEnd are called from there). frm as global variable fails too as Navision let go of the instance immediately.
A solution could be:
- A single instance Codeunit to hold the Status of the OK2Exit variable
- User must close Main Menu before closing Navision.
Not much of a help though :oops:
(Would be nice with an exit type user/system in the Currform!)It is impossible to make anything foolproof, because fools are so ingenious.0 -
Hi,
try this in the OnQueryCloseForm-Trigger
IF NOT CONFIRM(Text001) THEN
EXIT(FALSE);
So users will asked before close Form.
If answered with "yes", the form will close and Navision can be closed too.
Have fun0
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