BCCL Documentation
Index

Key Features

BCCL provides a comprehensive set of features for moving data into, out of, and within Business Central. This page summarizes the major capabilities so you can quickly identify how BCCL fits your requirements.

Multi-Format Data Support

BCCL supports five data formats, giving you flexibility to work with whatever your source or target system produces or consumes:

Format Extension Use Case
JSON .json Web integrations, APIs, structured data exchange
XML .xml Enterprise integrations, EDI-adjacent workflows
CSV .csv Spreadsheet workflows, flat file exchange, legacy systems
Excel .xlsx Business user data entry, formatted reports
SQL .sql Direct SQL Server replication, data warehousing

For CSV files, you have full control over delimiters, quote characters, header rows, and language-specific formatting. For XML files, you specify the repeating element path so BCCL knows where individual records live. For Excel files, you specify the sheet name and data range.

Data Export (GETDATA)

The GETDATA task exports data from any Business Central table. You control the output precisely:

  • Filtering -- apply table views to export only the records you need, using standard Business Central filter syntax
  • Paging -- large exports are automatically broken into pages to stay within web service size limits; the default page size is configurable
  • Column selection -- use mapping files to include only the fields you want, reducing file size and simplifying downstream processing
  • Column renaming -- rename Business Central fields to match the column names your target system expects
  • Format strings -- apply formatting to field values during export
  • Binary fields -- optionally include blob and media fields in your export
  • Language support -- for CSV exports, specify a language ID to control date and number formatting

Output can be written to a file or displayed directly on screen (stdout).

Data Import (PUTDATA)

The PUTDATA task imports data into any Business Central table. BCCL handles the complexity of inserting or updating records:

  • Smart insert/update -- BCCL automatically determines whether to insert a new record or modify an existing one based on the primary key
  • Field validation -- you control whether Business Central's field validation triggers run during insert and modify operations, through the ValidateOnInsert and ValidateOnModify settings in the mapping file
  • Auto number series -- when inserting records into tables that use number series (like customers or vendors), BCCL can use Business Central's number series to assign the next number automatically
  • Delayed insert pattern -- optionally fill in all field values before calling Insert(), which is useful for tables with complex validation logic
  • Stub record creation -- when importing data that references records in related tables (like a customer's country code), BCCL can automatically create minimal "stub" records in those related tables to prevent validation errors
  • Multiple input formats -- import from JSON, XML, CSV, Excel, or SQL Server query results

SQL Server Direct Replication

One of BCCL's most powerful features is direct replication from Business Central to SQL Server:

  • Table creation -- BCCL generates SQL CREATE TABLE statements that match the Business Central table structure
  • Data sync -- export Business Central table data directly into SQL Server tables using MERGE statements
  • Incremental replication -- use the Change Log to replicate only records that have changed since the last sync
  • Deletion tracking -- the CHANGELOG task can detect deleted records and propagate those deletions to your SQL Server replica
  • SQL pre-commands -- execute SQL statements before each sync operation (for example, to truncate staging tables)
  • SQL Bundle Builder -- a Business Central report that generates complete replication scripts for multiple tables at once, including the initial --remember command line

The SQL format uses parameterized MERGE statements (upserts) to handle both inserts and updates efficiently.

Change Log Based Incremental Replication

The CHANGELOG task reads from Business Central's built-in Change Log to detect records that were inserted, modified, or deleted since a given point in time:

  • Works with the SQL format to replicate changes to SQL Server
  • Supports filtering by date/time range, table number, and change type
  • Enables near-real-time replication when combined with frequent scheduling
  • Handles deletions by propagating DELETE statements to the target SQL table

Field Mapping

Field mapping gives you fine-grained control over which fields are transferred and how they appear in the target:

  • Column selection -- choose exactly which fields to include or exclude
  • Column renaming -- map Business Central field names to different column names in your files or SQL tables
  • Format strings -- apply .NET-style format strings to control how values are rendered
  • Dimension handling -- the DimensionFromSet function extracts individual dimension values from Business Central's Dimension Set ID, so you can include dimensions like "Department" or "Project" as separate columns
  • Field validation control -- specify per-field whether the field's OnValidate trigger should fire during import
  • Offset -- apply numeric offsets to field values during mapping

You generate a mapping template with the MAPPING task, edit it to your needs, and then reference it with the -m parameter during import or export.

Mass Update Operations

The MASSUPDATE task lets you update many records at once with the same set of values. You specify a table, a filter (view), and the field values to apply. This is useful for bulk corrections, status changes, or setting default values across a range of records.

Delete Operations

BCCL provides two deletion mechanisms:

  • DELETEDATA -- deletes specific records identified by an input data file (the file contains the primary key values of the records to delete)
  • DELETEALL -- deletes all records in a table that match a specified filter, with an optional validate parameter to control whether the OnDelete trigger fires

Document Posting

BCCL can post Business Central documents directly:

  • POSTSALES -- posts sales documents (invoices, orders, credit memos) by specifying the document type, document number, and action (ship, invoice, or ship+invoice)
  • POSTPURCHASE -- posts purchase documents by specifying the document type and document number

This enables automated posting workflows without user interaction in the Business Central client.

Run Codeunit

The RUNCODEUNIT task executes any codeunit in Business Central by its number. This is a powerful escape hatch for running custom business logic, batch jobs, or any AL code that you have deployed as a codeunit.

File Upload and Download

  • UPLOAD -- sends a binary file from your local machine (or FTP/SFTP server) to Business Central, associated with a Service Task
  • DOWNLOAD -- retrieves a binary file from a Service Task in Business Central

These operations support file-based workflows where documents, PDFs, images, or other binary content need to move between systems.

Service Tasks

Service Tasks let you define data operations inside Business Central and execute them from the BCCL client running as a service agent:

  • Define tasks in BC -- specify the table, filter, format, mapping, input/output files, and schedule directly in Business Central's UI
  • Agent-based execution -- a BCCL client running as a service agent polls Business Central for pending tasks and executes them automatically
  • Logging -- each task execution is logged with start time, end time, status, and output
  • Task cloning -- create copies of existing tasks for similar operations on different tables
  • Available Agents factbox -- see which agents are currently connected and their status

Windows Service Mode

You can run BCCL as a Windows service for always-on, unattended operation:

  • Place a BCCL_Service.json configuration file next to the BCCL executable
  • The configuration specifies connection details, authentication method, and the agent ID
  • Register BCCL as a Windows service using standard sc create commands
  • The service polls Business Central every 10 seconds for pending Service Tasks
  • All three authentication methods (Basic, OAuth, S2S) are supported in service mode
  • Service events are logged to the Windows Event Log

Request Builder

The Request Builder is a graphical page inside Business Central that helps you construct BCCL command lines without memorizing parameter syntax:

  • Select the task type, table, filter, format, and other options from dropdown fields
  • The page builds the complete command line in real time as you make selections
  • Includes a Mapping Builder for selecting and configuring field mappings visually
  • You can download a ZIP file containing the command script (for Windows .cmd, PowerShell .ps1, and Linux/macOS .sh) along with the mapping file

FTP/SFTP/FTPS File Storage

BCCL can read input files from and write output files to remote file servers:

  • FTP -- standard File Transfer Protocol
  • FTPS -- FTP over TLS/SSL
  • SFTP -- SSH File Transfer Protocol

You specify the file storage protocol and connection settings (URL, username, password, certificate) on the command line or in Service Task configuration.

Cross-Platform Client

The BCCL client runs natively on:

  • Windows (64-bit) -- includes Windows service support
  • macOS (64-bit)
  • Linux (64-bit)

The same command-line syntax works on all platforms. The Windows service feature is available only on Windows.

Three Authentication Methods

BCCL supports three ways to authenticate with Business Central:

Method Flag Best For
Basic --auth Basic (default) On-premises environments, simple setups
OAuth --auth OAuth Cloud environments, interactive user sessions (1-hour token)
S2S --auth S2S Automated/scheduled operations, service accounts, long-running tasks

OAuth uses the device code flow -- you authenticate in a browser and BCCL receives the token. S2S (Service-to-Service) uses client credentials from an Azure AD / Entra ID app registration, making it ideal for unattended automation.

Remember Settings

The --remember flag stores your connection parameters, credentials, and preferences in isolated storage. On subsequent runs, you only need to specify the parameters that differ from the remembered values. Use --forget to clear all stored settings and tokens.

Extensibility

Other Business Central extensions can register custom request types with BCCL by subscribing to the OnRegisterExtraTaskType integration event on the BCCL Initialization Hgd codeunit. This lets you add domain-specific operations beyond the built-in task types.