How to log into Event Viewer

mahesh
Member Posts: 115
Hi Nav Guys,
Is there any way to write a error log in Event Viewer from Navision??
(using Automation/OCX Control)
Our company customized Job Scheduling functionality in which i do generate error log in one table but Client wants same kind of log in Event Viewer also.
Is there any way to write a error log in Event Viewer from Navision??
(using Automation/OCX Control)
Our company customized Job Scheduling functionality in which i do generate error log in one table but Client wants same kind of log in Event Viewer also.
0
Comments
-
If job scheduling is handled by NAS (navision application server) then error messages will occur in event viewer automatically.0
-
if you use NAS for sheduling, he writes autom. all errors in Event log.
If you use a client and you will write data in Event Log u can do this with WSH-Shell. Search the Forum for WSH Shell
RegardsDo you make it right, it works too!0 -
garak wrote:if you use NAS for sheduling, he writes autom. all errors in Event log.
If you use a client and you will write data in Event Log u can do this with WSH-Shell. Search the Forum for WSH Shell
Regards0 -
right ;-)
I#ve not say this, because i would, that the user use her brain ;-)Do you make it right, it works too!0 -
hi kine,
i want to know the parameter to logevent method. give me some example of this.
[BOOL LogEvent :=] WindowShell.LogEvent(VAR VARIANT Type, BSTR Message[, BSTR Target])
eg.
WindowShell.LogEvent('Error','this is an error message');
i have written this code. but it is showing me an error [-o<Experience Makes Man Perfect....
Rajesh Patel0 -
Because the first parameter is variant, you need to define Variant variable and use it as the first parameter. For details there is the original help for this function:
http://msdn.microsoft.com/en-us/library/b4ce6by3(VS.85).aspx0 -
i have solved this problem.
CREATE(WindowShell);
WindowShell.CurrentDirectory(ENVIRON('windir') + '\system32\');
txtCommand := '1';
IF WindowShell.LogEvent(txtCommand,'hi') THEN
MESSAGE('sucessful')
ELSE
MESSAGE('false');
in above code i was using txtCommand := 'Error' instead of txtCommand := '1' .
thank you everybody for your kind support.
=D> =D> =D>
Regards,Experience Makes Man Perfect....
Rajesh Patel0 -
thanx to all.
problem is solved.
Control Panel->Administrative Tools->Event Viewer.
Event Viewer Window contains fields Type,Date,Time, Source, Category, Event ID, User, Computer.
But im still seeking to fill fields like Category & Source from Navision.
currently by default
Type:Error
Source: WSH (Windows Shell)
Category : None
Event ID: 1
Can i have Source:"MS Navision" & Category:"PDF Print"???0 -
I am using this in a codeunit's TryFunction in Dynamics NAV 2017 to collect some client-side information into a remote server's Event Log and it works:
Name DataType Subtype Length lEventLogObject DotNet System.Diagnostics.EventLog.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' pDebugMessage: Text CLEAR(lEventLogObject); lEventLogObject := lEventLogObject.EventLog('Application','remoteserver.companydomain.local','NAVDebugLog'); lEventLogObject.WriteEntry(pDebugMessage);
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
- 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