Has anybody been able to handle Navision errors, without using NAS and timers?
If there is a way of closing the error dialog boxes automatically without user intervention and continuing with code execution using something developed in VB.NET perhaps?
Example code would be great
Thanks in advance.
0
Comments
Sometimes you will find an additional function "SetHideDialog" or similar:
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
I see that this “Hidedialog” is used in the system mainly in codeunits, and reports and tables.
Can it be used in form where I click a button and try and assign a string value of say “this is a test” into a variable defined as type text[2], which would cause an error dialog “ overflow under under type convesion of text to text” to be displayed?
Here is the object in question
[code]
OBJECT Form 50067 test
{
OBJECT-PROPERTIES
{
Date=05/10/25;
Time=[ 2:53:38 PM];
Modified=Yes;
Version List=stuart;
}
PROPERTIES
{
Width=3300;
Height=1210;
}
CONTROLS
{
{ 1000000001;CommandButton;110;110;2200;550 ;CaptionML=ENU=test button;
OnPush=BEGIN
Txt_TestVariable := 'This is a test';
END;
}
}
CODE
{
VAR
Txt_TestVariable@1000000000 : Text[2];
BEGIN
END.
}
}
[code][/code]
If you want to avoid error messages, you (as developer) has to make sure, that all possible errors will be handled in any way.
For your example, you have to check the field length before assigning the value.
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
The actual reason for all of this (believe it or not) is because I am trying to run automated reports. Since I can’t use NAS to run reports, I tried using the scheduler to execute the fin.exe, which would load up an instance of navision on the server as a sort of background service. Navision would then load a form on startup which would run a timer and run predefined reports and save then as HTML files and then e-mail those reports.
This all worked fine except that if the report generated an error for whatever reason, the form that was executing the report would display an error dialog, even though I used the timmer.dll event error handler. This would stop code at that point and prevent logging the error and e-mailing that error of to me. If I click on the error dialog, then the code continues and the error is logged and emailed etc. Unfortualnely, as I am running this form using the scheduler as a sort of background service so there is no way of clicking on the error dialog.
So…what I would actually like to do is execute reports in NAS, which solve all of this nonsense.
I’m using NAV 3.01 by the way.
So maybe you can do a technical upgrade to use the new NAS capabilities?
So that solves that proplem, except i only have Navision 4.0 and the asp ODBC scripting is less effiecent(by 10 - 40 seconds) in one of my SQL statements than ver 3.01 CODBC(belive it or not). - but thats something else to work on. Just Swings and roundabouts eh?!?
Thanks for all the help guys.