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.
0
Comments
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
Regards
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I#ve not say this, because i would, that the user use her brain ;-)
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<
Rajesh Patel
http://msdn.microsoft.com/en-us/library/b4ce6by3(VS.85).aspx
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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,
Rajesh Patel
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"???
Mahesh Jain
mahesh@reliconservices.com