SharePoint Connector Documentation
Index

Generating Documents

This page explains how to generate documents from templates and save them directly to SharePoint from within Business Central.

Generation Overview

What Happens

When you generate a document:

  1. Select a record (e.g., Customer)
  2. Choose a template
  3. Report runs with record data
  4. Output is formatted (PDF/Word/Excel)
  5. File is uploaded to SharePoint
  6. File appears in FactBox

Prerequisites

To generate documents, you need:

  • Table mapping for the record type
  • Document template configured
  • SharePoint connection active

Generating from the FactBox

Step-by-Step

  1. Open the record (Customer, Vendor, Job, etc.)
  2. Locate the FactBox on the right side
  3. Click "Generate Document" or similar action
  4. Select a template from the list
  5. Complete request page (if shown)
  6. Wait for generation to complete
  7. Verify in FactBox - file should appear

Visual Walkthrough

Customer Card: Contoso Ltd
├── [Details tab]
├── [Address tab]
└── [SharePoint FactBox]
    ├── Files: Quote.pdf, Contract.pdf
    └── [Generate Document] ← Click here
        └── Select: "Customer Statement"
            └── Request Page (date range)
                └── OK → Statement generated

Selecting Templates

When Multiple Templates Exist

If multiple templates are configured:

  1. Click Generate Document
  2. List of available templates appears
  3. Select the one you want
  4. Continue with generation

Template List Example

Template Description
Customer Statement Monthly statement
Account Balance Current balance report
Sales History Sales transaction history

Request Page Options

When Request Page is Enabled

If the template has "Show Request Page" enabled:

  1. Report's request page appears
  2. Set any required parameters
  3. Click OK to generate

Common Parameters

Parameter Purpose
Date filter Limit to date range
Include details Level of detail
Show balance Include running balance

Skipping Request Page

If "Show Request Page" is disabled:

  • Report runs with default parameters
  • Faster for standard documents
  • Set parameters in template if needed

Output Location

Default Location

Documents are saved to:

  • The record's main SharePoint folder
  • Or the Optional Subfolder (if configured in the template)

Example Paths

Record Subfolder Result
Customer: Contoso (none) /Customers/Contoso Ltd/Statement.pdf
Customer: Contoso Statements /Customers/Contoso Ltd/Statements/Statement.pdf
Job: Alpha Reports /Projects/Alpha/Reports/Quote.pdf

File Naming

Dynamic Names

Generated files are named based on template configuration:

Template Description Generated Name
Statement Statement.pdf
Statement %1 Statement Contoso Ltd.pdf
Statement %3 Statement 2024-01-15T14.30.45.pdf
%1 Statement %3 Contoso Ltd Statement 2024-01-15T14.30.45.pdf

Overriding the Name for a Single Run

The template picker includes a New Name field. Enter a value there to override the template's Description for that single generation run -- the template itself is not changed, and the next run uses the template's normal naming again.

Avoiding Duplicates

If a file with the same name exists:

  • Check your naming configuration
  • Use date/time placeholder (%3)
  • Use unique identifiers

Generation Progress

During Generation

While generating:

  • May see progress indicator
  • Report processing
  • Upload in progress

After Generation

When complete:

  • FactBox refreshes
  • New file appears in list
  • File is ready to open

Generating Multiple Documents

Same Record, Different Templates

You can generate multiple documents:

  1. Generate Statement
  2. Generate Account Balance
  3. Generate Sales History

Each becomes a separate file.

Multiple Records

For multiple records:

  • Generate from each record individually
  • Or use batch operations for mass generation

Error Handling

Generation Errors

Error Cause Resolution
Report error Report has issues Test report manually
No data Record has no data for report Check data exists
Permission Can't write to SharePoint Check permissions
Path error Invalid folder path Verify mapping

Troubleshooting Steps

  1. Test report manually - Run report outside connector
  2. Check SharePoint - Verify folder exists and is accessible
  3. Check template - Verify configuration is correct
  4. Check connection - Test SharePoint connection

Best Practices

Effective Use

Practice Benefit
Use meaningful names Easy to find files
Include dates Version tracking
Use subfolders Organization
Apply categories Visual identification

When to Generate

Scenario Action
Customer meeting Generate statement beforehand
End of month Generate monthly reports
Project milestone Generate progress report
On demand Generate as needed

Integration with Other Features

Categories

Generated documents can have auto-assigned categories:

  • Set in template configuration
  • Appears immediately in FactBox
  • Enables filtering and email attachment

E-Signing

After generation:

  1. Document appears in FactBox
  2. Select the document
  3. Send for e-signature
  4. Track signing progress

Metadata

If metadata mapping is configured:

  • Metadata is populated on upload
  • BC field values → SharePoint columns
  • Enables SharePoint searching

Alternative: Auto-Upload

Difference from Templates

Feature Templates Auto-Upload
Trigger Manual action Posting event
Documents Any report Posted documents
Control User selects Automatic

Use templates for on-demand generation, auto-upload for posting automation.