Skip to content

Folder Structure

Folder Structures

In the Document Archive Setup (wizard) page the File Handler and File No. Series fields are already filled with initial/defaults values.

Please note that File Handler currently has a single option: SharePoint.

In the field Remote Folder Structure you can define in which way the files are stored:

  1. Based on No. Series - Files are stored with an automatically generated ID/"No." as the file name.
  2. Based on Entities (Recommended) - Files are stored in folders per entity/document type.
  3. Custom Folder Structure - Files are stored in a custom folder structure.

When you use the Based on Entities option, there are 3 built-in Remote Folder Order options that you can select:

  • <Environment>/<Company>/<Entity>
  • <Environment>/<Company>/<Category>/<Entity>
  • <Environment>/<Company>/<Entity>/<Category>

When you switch from Based on No. Series option to Based on Entities option (or back) a confirmation dialog will be shown asking you what you would like to do with the existing files:

If you choose Yes, then you will be prompted whether you want to move any existing files to the new structure:

  • Move files will move the files and modify the internal registration of the files.

  • Continue without moving files will keep the folder structure and the internal registration as is. However, new files will be stored according to the new setup.

What it looks like on SharePoint:

  1. Example of Remote Folder Structure set up with the Based on No. Series option:

    It is based on the type of environment, the name of the company followed by the main folder DCA000000 where it will store the individual files. In Business Central you will see the original filename and extension.

  2. Example of Remote Folder Structure set up with the Based on Entities option:

    According to the Remote Folder Order option: <Environment>/<Company>/<Entity>

    Within the Customer folder a folder per "Customer No." is created where the files are stored per customer. The same goes for other entities and documents (e.g., a folder per sales order).

    The other 2 built-in options to store the files will add the Category code as a folder in different places, so you can choose how to store the files.

Custom Folder Structure

With the Custom Folder Structure you can configure the folder structure of the file storage completely free for your business case.

With choosing the option Custom Folder Structure new options are made available. Custom Folder Structure

You can open the Folder Structures list page on the Document Archive Setup page. On this page you can view and or edit folder structures. These will be available for all companies in the Business Central environment.

Folder Structures

A Folder Structure is defined by the following fields.

Field Description
Code The code of the folder structure configuration that the current company should use when files are uploaded to the remote file storage location
Description The description of the folder structure configuration that the current company should use.
Language The language that should be used for generating folder structure paths (e.g., translate Table Caption in a single language). This field is mandatory. For upgrading customers it is initialized with "English (United States)" considering previously the folder name parts were fixed to English untranslated labels. For new customers it is initialized with the language that the user selected on extension installation (i.e., user language).

Note

You can also Export and Import (one or more) folder structures to an XML file. A sample folder structure will be available automatically (it is automatically generated on-install or on-upgrade of the extension). You can also choose to (re)create it using the Create Sample Folder Structure action.

There is a Copy action to copy an existing folder structure to a new folder structure: Copy Folder Structure

Copy Folder StructureSample

On the Folder Structure card page you can find the configuration of the folder structure. First of all, each folder structure will have a Code (max. length = 30) and a Description (max. length = 100). Folder Structure Card

A folder structure can have a Root Folder Structure which makes up the first part of the folder paths that will be generated by the folder structure configuration when it is used. You can also specify a Default Folder Structure which specifies how the folder path part that comes after the root folder path will be determined. For both the Root and Default Folder Structure you can choose generic properties using the Entry Type field.

The following options are available to select for the Entry Type field for the root and/or default folder structure.

Option Description
Environment Name The current Business Central environment's name
Company Name The name of the current company
Company Display Name The display name of the current company
No. Series No. The number of the file record
Category Code The code of the category of the file record
Category Description The description of the category of the file record
Table No. The table number of the source record that the file record is linked to
Table Name The table name of the source record that the file record is linked to
Table Caption The table caption of the source record that the file record is linked to
Entity Name (singular) Use the name of known entities such as "Posted Sales Invoice" (singular form). For unknown entities/tables fall back on the "Table Caption"
Entity Name (plural) Use the name of known entities such as "Posted Sales Invoices" (plural form). For unknown entities/tables fall back on the "Table Caption"

Both the Root and Default Folder Structure definitions are made up multiple entries. The entry numbers begin at 1. The New Subfolder property can be used to specify whether the entry will start a new subfolder in the folder path or if the entry's value will be appended to the text of the current (sub)folder.

You can also use the Prefix and Suffix properties to prepend or append fixed text to the entry's value (e.g., you could let the entry make a new subfolder that starts with "Environment - " followed by the BC environment name).

If you selected Entry Type = Fixed Text then you can enter a fixed text to add to the folder path in the Fixed Text field.

Folder Structure Path Sample

In the Folder Path Sample group you can find a preview of a sample folder path to get an idea of what the folder path will look like.

Warning

Some changes you might need to refresh the page to update this sample.

Note

The sample will be translated based on the Language you selected in the Document Archive Setup in the current company. (So, in the example above the folder path sample was translated to "Dutch".)

Preview Remote Folder Path

Tip

If you would like to get a sample folder path that would be produced for an actual record in BC then you can use the Preview for Record action on the card page to select a record to get a preview of the folder path that would be used for that record.

Preview for Record

With the Table-Specific Folder Structure list part you can specify folder structures for specific tables that should be used instead of the Default folder structure.

You can even use the Table Filters field to restrict these table-specific folder structures to specific records (e.g., considering sales orders and sales quotes are both stored in the same table (36 "Sales Header") you could set up a table-specific folder structure specifically for Sales Orders if you would wish to).

You could use the (optional) Description field to provide more details/explanation for the table-specific folder structure configurations. Table Specific Folder Structure

On the Table-Specific Folder Structure card page you can configure the table-specific folder structure for specific table(record)s.

If you switch off the Enabled field you can make it so that this table-specific folder configuration is skipped when Document Archive determines the folder path for a file.

On the Folder Path Structure list part you have the same options available as for the Root and Default Folder structure, but note that there are a few additional options

In the Entry Type field you now have some table-specific entry types next to the generic entry types, which include.

Entry Type Description
Field No. A field number
Field Name The name of a field of the source record that the file record is linked to
Field Caption The caption of a field of the source record that the file record is linked to
Field Value The caption of a field of the source record that the file record is linked to

If you select any of the "Field"-related entry types, then you can specify which table field to use using the Field No. field on the folder path entry record.

Again on this page you will find a Folder Path Sample group and Preview for Record action that you can use to view sample folder paths for this table and specific records from this table.

Caution

Changing to or changing the Custom Folder Structure itself won't move the original files to the new file location. The files need to be moved manually.


Last update: January 22, 2024