SharePoint Connector Documentation
Index

SharePoint Table Mapping

Table mapping is the core configuration that connects Business Central tables to SharePoint folders. This page explains how to create and manage table mappings.

Accessing Table Mapping

  1. Search for "SharePoint Table Mapping" in Business Central
  2. The list page shows all configured mappings. The list itself is read-only -- all editing happens on the card
  3. Click on a mapping to open the Table Mapping Card for detailed editing

Creating a New Mapping

Step 1: Open Table Mapping

  1. Go to SharePoint Table Mapping
  2. Click New to create a new mapping, which opens the Table Mapping Card

Step 2: Select the Table

Field Description How to Choose
Table No. The BC table to map Use lookup to find table
Table Displays automatically Confirms selection

Common tables to map:

Table No. Table Name Typical Use
18 Customer Customer documents
23 Vendor Vendor documents
27 Item Item specifications
167 Job Project documentation
36 Sales Header Sales documents
38 Purchase Header Purchase documents

Step 3: Configure Folder Structure

Field Description Example
Folder Name Base folder for this table Customers
Folder Name Field No. Field used for subfolder name Name field
Folder Name Specification Field Optional: makes name unique No. field

Step 4: Set Mapping Method

Method Use When
Static Standard folder per record; the folder link is stored when the folder is created
Dynamic Folder name is recomputed from the record's current field values on every access
Only Columns The table should not show the SharePoint FactBox (disables folder integration)
Inherited Dynamic Documents inheriting parent

Step 5: Configure Site (Optional)

For multi-site scenarios:

Field Description Example
Site Name (Override) Override default site (no leading /) sites/sales, teams/sales, or sales
Document Library (Override) Override default document library. Required whenever Site Name (Override) is filled Documents

Important: If you fill in the Site Name (Override), you must also fill in the Document Library (Override). A mapping with a Site Name but an empty Document Library fails at runtime with the error Mapping for <table> is missing a base folder, cannot continue!.

Step 6: Configure Auto Email Attachments (Optional)

If you want files to be automatically attached when emailing documents:

Field Description
Auto Email Categories Filter Select which file categories to attach
Auto Email Sub Folder Subfolder to look in (leave blank for root)

Step 7: Save the Mapping

  1. Close the card to save
  2. Mapping is now active

Mapping Fields Reference

Basic Fields

Field Type Description
Table No. Integer Primary key - the BC table
Folder Name Text[100] Base folder name for the table
Folder Name Field No. Integer Field number for folder naming
Folder Name Specification Field Integer Secondary field for naming
Mapping Method Option How folders are structured (Static, Dynamic, Only Columns, Inherited Dynamic)

Override Fields

Field Type Description
Site Name (Override) Text[100] Override SharePoint site
Document Library (Override) Text[100] Override base document library path

Parent Relationship Fields

Field Type Description
Parent Table No. Integer Parent table for inheritance
Parent Link Field 1 Integer Field linking to parent primary key field 1
Parent Link Field 2 Integer Field linking to parent primary key field 2
Parent Link Field 3 Integer Field linking to parent primary key field 3

When a parent table is selected, the Table Mapping Card displays information about the parent table's primary key fields, helping you map the correct fields.

Auto Email Attachment Fields

Field Type Description
Auto Email Categories Filter Text[200] Filter for which file categories to attach to outgoing emails
Auto Email Sub Folder Text[100] Optional subfolder to look in for auto email attachments

Example Mappings

Customer Mapping

Field Value
Table No. 18 (Customer)
Folder Name Customers
Folder Name Field No. 2 (Name)
Folder Name Specification Field 1 (No.)
Mapping Method Static

Result: /Shared Documents/Customers/Contoso Ltd (C00010)/

Vendor Mapping

Field Value
Table No. 23 (Vendor)
Folder Name Vendors
Folder Name Field No. 2 (Name)
Mapping Method Static

Result: /Shared Documents/Vendors/Fabrikam Inc/

Sales Order Mapping (Inherited)

Field Value
Table No. 36 (Sales Header)
Mapping Method Inherited Dynamic
Parent Table No. 18 (Customer)
Parent Link Field 1 4 (Bill-to Customer No.)

Result: Sales orders appear in the customer's folder

Item Mapping

Field Value
Table No. 27 (Item)
Folder Name Items
Folder Name Field No. 3 (Description)
Folder Name Specification Field 1 (No.)
Mapping Method Static

Result: /Shared Documents/Items/Widget Model X (ITEM001)/

Auto Email Attachments

The SharePoint Connector can automatically attach files from SharePoint to outgoing emails sent from Business Central. When you send a document by email (for example, a sales invoice), the connector retrieves files from the record's SharePoint folder and adds them as attachments to the email. For a complete walkthrough including filter expressions and troubleshooting, see Auto Email Attachments.

How It Works

  1. When you send a document by email, the connector looks up the table mapping for the record
  2. If an Auto Email Categories Filter is configured, it retrieves files from the record's SharePoint folder
  3. Files matching the specified category filter are downloaded and attached to the outgoing email
  4. If an Auto Email Sub Folder is specified, only files in that subfolder are considered

Configuring Auto Email Attachments

  1. Open the Table Mapping Card for the relevant table
  2. In the Auto Email Attachments section:
Field Description Example
Auto Email Categories Filter Category filter for files to attach. Use the lookup to select from configured categories. Supports filter expressions. Contract or Contract&#|;Quote
Auto Email Sub Folder If files are in a subfolder, specify it here Email Attachments

Example: Auto-Attach Contracts to Sales Emails

Setting Value
Table 18 (Customer)
Auto Email Categories Filter Contract
Auto Email Sub Folder (blank - look in root folder)

When you email a sales invoice for a customer, all files categorized as "Contract" in that customer's SharePoint folder will be automatically attached to the email.

Prerequisites

  • The table must have an active table mapping configured
  • File categories must be set up for the table (see File Categories)
  • Files must be assigned to the matching category in SharePoint
  • A valid SharePoint connection must be active

Managing Existing Mappings

Viewing Mappings

The Table Mapping list shows:

  • All configured table mappings
  • Folder name for each
  • Mapping method
  • Parent table (if any)

Editing Mappings

  1. Select the mapping in the list and open it -- the list is read-only, so all changes are made on the Table Mapping Card
  2. Make changes on the card
  3. Changes take effect for new folders
  4. Existing folders are not automatically renamed. Use Rename mapped folder on the Change Mapping page to rename a folder and its mappings, see Folder Mapping Concepts

Deleting Mappings

  1. Select the mapping
  2. Delete the record
  3. Existing folders remain in SharePoint
  4. FactBox will no longer show for that table

Best Practices

Planning Mappings

Before creating mappings:

  1. Document your folder structure - Plan the hierarchy
  2. Identify key tables - Start with most important
  3. Plan naming conventions - How folders should be named
  4. Consider relationships - Which documents belong where

Naming Recommendations

Recommendation Reason
Use meaningful folder names Easy to find in SharePoint
Include identifiers Avoid duplicate names
Avoid special characters Prevent path issues
Keep names reasonable length Path limits in SharePoint

Configuration Order

Configure mappings in this order:

  1. Parent tables first - Customer, Vendor, Job
  2. Child tables second - Sales Header, Purchase Header
  3. Posted documents last - Invoice headers, credit memos

Validating Mappings

Check Mapping Configuration

After creating a mapping:

  1. Open a record of that table type
  2. Look for the SharePoint FactBox
  3. Upload a test file
  4. Verify in SharePoint that structure is correct

Common Validation Issues

Issue Check
FactBox not visible Is mapping saved? Correct table?
Wrong folder path Check folder name and caption field
Duplicates Add specification field for uniqueness
Missing parent Verify parent table mapping exists

Active Mapping Management

Viewing Active Mappings

To see which records have active SharePoint folders:

  1. Open the Table Mapping Card (or list) and choose the Active Mapping action -- the Active SharePoint Mapping page is not searchable in Business Central
  2. View the list of mapped records
  3. See folder paths for each

Removing Active Mappings

If you need to unlink a record from its folder:

  1. Find the record in Active SharePoint Mapping
  2. Delete the mapping record
  3. The folder remains in SharePoint
  4. The link is broken