The Microsoft Dynamics NAV Application Server, sometimes
referenced as the Classic server, is a Classic Architecture
component in Microsoft Dynamics NAV 2009. There is no graphical
user interface (GUI) on the Microsoft Dynamics NAV Application
Server, therefore, there are some limitations on the C/AL code that
can run on the application server. For more information, see the
GUIALLOWED
Function.
The following functions are available when running Microsoft
Dynamics NAV Application Server:
The following functions are not available in Microsoft Dynamics
NAV Application Server:
Error Logging
When you run C/AL code with triggers containing functionality
that invokes GUI, an error occurs. A corresponding error message is
posted in the NT event log. For more information about message
logging, see the manual "Installation & System Management:
Microsoft Dynamics NAV Application Server".
Calls to the following functions will create errors:
-
FORM, DIALOG, and CONFIRM: An error is displayed when the
Application server runs from the Microsoft DOS command line. When
Microsoft Dynamics NAV Application Server runs as a service, an
error message is logged.
-
MESSAGE and ERROR: An error message is logged.
Important |
REPORT and DATAPORT functions are not available. OCX and
AUTOMATION functions are available. However, if they invoke GUI
functions, they may cause Microsoft Dynamics NAV Application Server
to stop running. The only way to restart the Application server is
to reboot.
|
Starting the Microsoft Dynamics
NAV Application Server
Before you can successfully start a Microsoft Dynamics NAV
Application Server, you must create a startup trigger on codeunit 1
with ID number 99. The trigger must have a parameter of type Text,
with a maximum length of 1024 characters. This parameter is passed
to the codeunit trigger, which is always executed when Microsoft
Dynamics NAV Application Server starts. This trigger is not defined
in the standard application. The interpretation of the text string
is the responsibility of the C/AL programmer. If you do not supply
the parameter, the Microsoft Dynamics NAV Application Server
startup procedure fails.
Communication Between Microsoft
Dynamics NAV Client and Microsoft Dynamics NAV Application
Server
To establish communication between a Microsoft Dynamics NAV
Classic client and Microsoft Dynamics NAV Application Server, you
need to start a timer. You can make the Application server start a
timer that triggers an event at a certain interval. When Microsoft
Dynamics NAV Application Server receives the event, it can check
the database for unprocessed tasks, such as an order.
A user that runs a Microsoft Dynamics NAV Classic client can
put, for example, a 'send order' task in the task table in the
database. Microsoft Dynamics NAV Application Server can then check
the database for this task.
Example
This is an example of what the startup trigger can look
like. First, the trigger instantiates a communication component.
Then, if the parameter passed equals 'Test,' the application server
is instructed to also look in the task table. The 'Test' parameter
starts a timer.
|
Copy Code |
InitComCom.RUN;
CASE StartupParm OF
'Test': InitializeTaskTable.RUN;
END;
|