External File Storage Connector
The folders your ForNAV local file service already exposes can be registered as a Business Central File Account, using the built-in External File Storage Connector framework. Once registered, any feature that lets you pick a File Account — such as Document Attachments — can read and write files on your own disks and network shares, with no Azure, SharePoint, or SFTP account in between.
Note
This connector requires Business Central version 28.0 or later.
Prerequisites
- The ForNAV local service is installed and connected to this Business Central environment.
- At least one alias is configured in
config.jsonfor the folder you want to expose — for example, an alias calledDOCUMENTSpointing at a network share.
If you run more than one file service — say, one per location — and need requests routed to a specific one, add a row for it on the ForNAV Direct Printer and File Routing page, leaving Local Printer blank so it counts as a file device. See multiple servers. With a single file service, there is nothing to set up here — leave Device blank on the account.
Setting up a File Account
- In Business Central, search for File Accounts and choose New.
- Pick ForNAV File Service as the connector.
- Fill in the fields below.
- Choose OK to register the account.
Once registered, the account appears in the File Accounts list like any other, and any feature that lets you pick a File Account can use it.
Fields
| Field | What it does |
|---|---|
Name |
A descriptive name for the account, shown wherever Business Central lets you pick a File Account. |
Device (optional) |
The device name from ForNAV Direct Printer and File Routing that this account uses to reach the file service. Set it only if more than one service is connected and requests need routing to a specific one; otherwise leave it blank. |
Root Path (optional) |
An alias, or an alias plus a subfolder, that every file and folder for this account is relative to — for example DOCUMENTS:\Invoices. Choose the field to browse available shares and folders, or type a path directly. Left blank, every alias on the service is exposed. |
How paths work
A path Business Central passes in — say, the folder shown while browsing attachments — is combined with the account's Root Path before it reaches the file service:
Root path DOCUMENTS:\Invoices + Requested 2024\March.pdf = Resolved DOCUMENTS:\Invoices\2024\March.pdf
The same alias-based addressing and security rules that govern the rest of the file service apply here — only folders reachable through a configured alias can be used, and the Windows permissions of the service user still decide what can be read or written.
Supported operations
Files: list files in a path, get (download), create (upload), copy, move, check existence, delete.
Folders: list folders in a path, create, check existence, delete (always recursive, contents included).
Limitations
- File size — keep individual files under roughly 50 MB, the same guidance as the rest of the file service. Use chunking in your own code for anything larger.
- No paging — listing a folder always returns its full contents in a single page.
- Recursive delete only — deleting a folder always removes everything inside it; there is no "only if empty" option.
- Errors stop the operation — any failure, such as an unreachable service or a path that does not resolve to an alias, stops the calling operation. There is no way to ignore file errors the way custom AL code can with
SetErrorAction— see error handling.
Troubleshooting
"We could not find the account. Typically, this is because the account has been deleted."
Cause: The File Account was deleted from Business Central — for example with Delete on the File Accounts page — but something still refers to it by its old ID.
Fix: Register the account again from File Accounts, and update whatever setup — such as a Document Attachments configuration — pointed at the old one.
"File share [alias] does not exist"
Cause: The Root Path does not resolve to a configured alias, or a subfolder underneath it — usually a misspelled alias, one not yet added to config.json, or, if Device is set, one missing from that particular service.
Fix: Confirm the alias exists in the service configuration for the relevant file service, and that the service has restarted since it was added. Then browse to the folder instead of typing the path, to rule out typos.
Timeout errors
Cause: Operations through this connector share the file service's usual request pipeline, so the usual causes apply — most often scanning a folder with a very large number of files.
Fix: Check the timeout setting on the ForNAV Direct Print and File Setup page.