Creating a custom NAS handler
The NAV Application Server is essentially a NAV client without a graphical interface. It can be used to automate exports or run any sort of code you might need for integration with software outside of the NAV system. This recipe will show you how to write the code to handle a custom application server.
Getting ready
You must have the NAV Application Server installed either on your machine or another server on your network.
How to do it...
Create a new codeunit from Object Designer.
Set the following properties on the codeunit:
Property
Value
SingleInstance
Yes
Add the following global variables to the codeunit:
Name
DataType
SubType
Timer
Automation
'Navision Timer 1.0'.Timer
Seconds
Integer
Add the following code to the
OnRun
trigger:IF ISCLEAR(Timer) THEN CREATE(Timer); Seconds := 60; Timer.Enabled := FALSE; Timer.Interval := Seconds * 1000; Timer.Enabled := TRUE;
Add the following code to the
Timer::Timer
event:MESSAGE('Processed');
Save and...