Exit Navision

winfried
Member Posts: 3
I'm looking for some piece of code to close Navision. Anyone here who can give me a hint?
0
Comments
-
If you mean: "How can I close a client from inside the C/AL?"
The answer is: "You can't!"
the EXIT command only means, exit the object or function you are in.Now, let's see what we can see.
...
Everybody on-line.
...
Looking good!0 -
There is one possibility (when you are running NT, W2K, W2003 or XP) and that's killing the fin.exe process through a shell.
But if you do this and you have two clients open, it will be pretty though to distinguish which one you want to kill.
Greetings,Now, let's see what we can see.
...
Everybody on-line.
...
Looking good!0 -
Thanks a lot for your very quick answer. Your first message tells me what I've expected. The second message could show the way ...
I'll tell you more, if a find a solution!
cu0 -
You can use Auto Close Idle. It works with Navision Financials or Attain, Native DB or SQL option. See here for details:
http://www.autocloseidle.com/
Regards,
Naji ShamanNaji Shaman
http://www.autocloseidle.com0 -
From within C/AL you can use the Windows Script Host Object Model to send keystrokes to your application (e.g. Alt-F,X).0
-
You can do such thing with automation.
Steps to do so:
1. Find the active window.
2. Find the topmost parent window (GetParent API).
3. Send WM_CLOSE command to the window found at 2. (I think it can be done with SendMessage.
Ofcourse you have to find yourself a VB or VC programmer first...
And.. this doesn't work in all situations, for example while there are still pending errors or messages that has to be clicked upon.
The piece for finding navision windows i have for you in VB code:Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, _ ByVal hWnd2 As Long, _ ByVal lpsz1 As String, _ ByVal lpsz2 As String) As Long Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function GetForegroundWindow Lib "user32" () As Long Public Sub GetHwnd(byref hwndFINEXE as long, byref hwndObjectDesigner as long, byref hwndMDIclient as long) Dim tmphwnd As Long tmphwnd = GetForegroundWindow Do hwndFINEXE = tmphwnd tmphwnd = GetParent(tmphwnd) Loop Until tmphwnd = 0 hwndMDIclient = FindWindowEx(hwndFINEXE, 0&, "MDICLIENT", vbNullString) hwndObjectDesigner = FindWindowEx(hwndMDIclient, 0&, vbNullString, "Object Designer") End Sub
In a world without Borders or Fences, who needs Windows and Gates?0 -
janpieter,
You are right about the error messages do not allow Navision to be closed. Navision also doesn't close if there was any Print Preview, Customer/Vendor/Quote/Invoices Lookup Lists, etc. windows open. Try closing Navision while any of these windows open and you would see a popup window.
ACI handles all these situations and more, plus you see all users. If there was a popup window present, ACI does nothing and allows you to use the Remote Control function to respond to the popup window and close Navision.
Regards,
Naji ShamanNaji Shaman
http://www.autocloseidle.com0 -
But can it be closed with C/AL coding with ACI?In a world without Borders or Fences, who needs Windows and Gates?0
-
Currently ACI does not have that feature. It's possible to add it, but this is the first time anyone requested it. A quick DLL or OCX can be made to tell ACI to close Navision in this case...
Regards,
Naji ShamanNaji Shaman
http://www.autocloseidle.com0
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