BCCL Documentation
Index

Export Performance and Intermittent Export Errors

A BCCL export that runs slowly, or that sometimes fails and sometimes succeeds, is most often explained by one thing: FlowFields in the exported table. This page describes the symptom, the diagnostic step, the cause, and the two supported remedies.


Symptom

Exporting Business Central data with GETDATA -- for example to CSV -- behaves inconsistently:

  • The same command sometimes completes and sometimes ends with an error.
  • The export takes a long time to complete, even for tables that do not seem large.
  • Failures appear intermittently rather than on every run.

Slow exports and intermittent export errors are related symptoms. If an export takes a long time, suspect FlowFields first, even when no error has appeared yet.


Diagnostic Step: Re-Run with Verbose Mode

Re-run the identical command with the -v (verbose) parameter added:

bccl -t getdata -s table=18 -f csv -o customers.csv -m customer.mapping.json -v

Verbose mode shows what BCCL is doing at each stage of the run and how long the web service calls take, so you can see where time is being spent and at what point a failure occurs. See Diagnosing with Verbose Mode for a description of the output.


Likely Cause: Slow FlowFields

FlowFields are calculated fields whose values are derived from other tables (for example Balance (LCY) on the Customer table or Inventory on the Item table). Business Central calculates a FlowField on read: when BCCL includes a FlowField in an export, Business Central runs the underlying calculation for each exported record before returning the value.

This means every exported record can trigger additional calculation work in Business Central. When a table contains several FlowFields, or when a FlowField sums over a large ledger, this calculation dominates the export runtime. A long-running export is an indication that slow FlowFields are involved.


Remedies

Apply these in order.

1. Reduce the Page Size

The -z parameter controls how many records BCCL requests from Business Central in each round trip (the default is 1000). A smaller page means fewer FlowField calculations per request, so each request completes sooner.

bccl -t getdata -s table=18 -f csv -o customers.csv -m customer.mapping.json -z 200

Start with a noticeably smaller value and adjust until the export runs reliably.

2. Remove FlowFields You Do Not Need

Only fields present in the mapping file are exported. Open the mapping file and delete the entries for FlowFields that the receiving system does not require. Fewer FlowFields means less calculation work per record and a faster, more reliable export.

If you are not using a mapping file, generate one first so you can control the field selection:

bccl -t mapping -s table=18 -o customer.mapping.json

Then edit it as shown in the worked example below and pass it with -m.


Worked Example

A customer export includes two FlowFields, Balance (LCY) and Sales (LCY), and only the balance is actually used downstream.

Before -- the mapping includes both FlowFields:

{
  "Customer": [
    { "FieldNo": 1,  "FieldName": "No.",           "MappedName": "No_",          "Validate": false },
    { "FieldNo": 2,  "FieldName": "Name",          "MappedName": "Name",         "Validate": false },
    { "FieldNo": 59, "FieldName": "Balance (LCY)", "MappedName": "Balance_LCY",  "Validate": false },
    { "FieldNo": 69, "FieldName": "Sales (LCY)",   "MappedName": "Sales_LCY",    "Validate": false }
  ],
  "ValidateOnInsert": false,
  "ValidateOnModify": false
}

After -- the unneeded FlowField is removed:

{
  "Customer": [
    { "FieldNo": 1,  "FieldName": "No.",           "MappedName": "No_",          "Validate": false },
    { "FieldNo": 2,  "FieldName": "Name",          "MappedName": "Name",         "Validate": false },
    { "FieldNo": 59, "FieldName": "Balance (LCY)", "MappedName": "Balance_LCY",  "Validate": false }
  ],
  "ValidateOnInsert": false,
  "ValidateOnModify": false
}

Command -- run with the trimmed mapping and a smaller page size, keeping -v until the export is stable:

bccl -t getdata -s table=18 -f csv -o customers.csv -m customer.mapping.json -z 200 -v

Once the export completes consistently, remove -v from the scheduled command.


Summary

Observation Action
Export sometimes fails, sometimes succeeds Re-run with -v to see where it fails
Export is slow Suspect FlowFields; check the mapping for calculated fields
FlowFields present Reduce -z, then remove FlowFields that are not needed
Still failing after both remedies Capture the full -v output and contact support

If It Still Fails

If the export still fails after reducing the page size and removing unneeded FlowFields, capture the complete -v output of a failing run and include it when contacting support. Remove any environment-identifying details (tenant IDs, credentials, connection strings, customer data) before sending it. See Getting Support for the other information to include.