Skip to main content

Remote Functions

The module connects Business Central to an external "remote functions" service, which performs operations not directly available in the system, for example:

  • reading and writing files on network folders or FTP servers;
  • extracting the content of digitally signed electronic invoices (.p7m files);
  • generating QR codes.

The module also adds the FileSystem transport to document exchange profiles, which lets you send and receive documents through shared folders or FTP.

  1. Search for the Remote Functions page.
  2. Create one line for each service you want to use and fill in the fields.
  3. Select the line and choose the Test Connection action: if the service responds correctly, the message Connection successful appears.
Field Description
Code Code identifying the service.
Description Free description.
API Endpoint Address of the remote functions service.
Token Access key for the service. The value is masked and stored securely.
Preferred Marks the service to use when a feature does not specify one.
Enabled Only enabled services can be used.

When a feature does not specify a service, the first service marked as both Preferred and Enabled is used, so it is advisable to have at least one.

If the service returns an error, the message is shown to the user.

When importing electronic invoices, files with the .p7m extension (digitally signed) are sent to the preferred service, which returns their XML content. This way signed invoices can be imported just like .xml files.

Document exchange profiles can use the FileSystem transport, which reads and writes documents in a (network) folder or on an FTP server through the remote functions service. Opening the transport setup from the profile shows the FileSystem Transport Setup page.

Field Description
Reference Code Document exchange profile the setup refers to.
Remote Functions Code Remote functions service to use. If blank, the preferred service is used.
Protocol FileSystem (folder) or FTP.
Text Encoding Encoding of sent files: UTF-8 or UTF-8 with BOM.
Receving Base Path Folder from which received files are read.
Archive Received Files If enabled, received files are moved to the archive folder after processing.
Preserve Original Archived File Name If enabled, the archived file keeps its original name (overwriting any file with the same name); otherwise the date and time are added to the name.
Receving Base Path (archive) Folder where received files are archived.
Sending Base Path Folder where sent files are written. A file with the same name is replaced.

This section is visible only when the protocol is FTP.

Field Description
URI Address of the FTP server.
Login User name for the server.
Password Access password. The value is masked and stored securely.
ASCII Mode If enabled, FTP transfers use ASCII mode.

In the Detail subpage, enter one or more Name Filter values (for example *.xml) for each document Category. When receiving, only the files in the receiving folder that match the filters of the requested category are read.

Choose the Do Test action and confirm the question Do read/write test?. A test file is created in the receiving folder, then listed, renamed, read and deleted. If everything succeeds, the message OK appears.