Table of Contents

Configuration of Service

How you configure your local service depends on what you want to use it for. If you use it for file access, you need a bit of extra setup to make it work. However, most of the configuration is the same. This configuration tells the service which Business Central environment to connect to.

Connect the service to your tenant

This step is universal and essential for running the print or file access. You need to connect the local service to your Business Central tenant.

Assuming that you have installed the Customizable Report Pack extensions from ForNAV on your Business Central, you can go to the page named ForNAV Direct Print and File Setup.

The toolbar has a link to Service Keys. Create a service key and download it. This will download a fornavconfig file to your computer. Move this file to the machine where the local service is installed and import it with the Direct Print user interface on the environments tab.

Import environment

After the import, it will try to connect to the environment. Depending on whether you connect to a cloud or an on-premises environment, you must set the authentication.

Config.json

C:\ProgramData\ForNAV\Direct Print\Configuration\config.json

File aliases

File access requires setting up which folders you want to work with. This is done by defining aliases.

Polling strategy

If you have many print or file operations, you may find changing the polling strategy helpful.

Instances

Running multiple processes to handle print jobs can sometimes improve performance. A configuration parameter controls the instance count for each service.

Memory limit

Poorly written printer drivers may not release all the memory when printing is done. Therefore, the print service's memory usage may build up over time. You can limit how much memory the print service is allowed to use. The default limit is approximately 4 GB.

If the limit is exceeded, the print service will restart the printing process, freeing up the allocated memory.

The memory limit is set in the config.json file.

{
  "Version": 1,
  "Environments": [
    {
      "Name": "default",
      "MemoryLimit": 1000000000,
      ...

The MemoryLimit value is the number of bytes you want as the limit for restarting the process.

Debug level

There is a DebugLevel setting in the config file that controls how much information is written to the log and shown in the console.

The default debug level is 0 (zero). Setting the debug level to 1 will add more information about the timing of operations. Values in the range from 0 to 3 are supported.

{
  "Version": 1,
  "Environments": [
    {
      "Name": "default",
      "DebugLevel": 1,
      ...

Environment files

A single local service can connect to multiple Business Central environments simultaneously. When you connect to a new environment, a configuration file is created in this folder:

C:\ProgramData\ForNAV\Direct Print\Configuration\Environments

The configuration files are locked to the machine where they were created because of the encryption. If you want to connect to the same environment on another machine, you need to import the service key on that machine.

Service Name

A file service identifies itself with a name. By default, the name of a file service is the name of the machine where it is installed. However, you can change the name if you need to.

To change the name, open the environment file and edit the name value.