Overview
The BC.WRITEBACK function sends one or more lines of values to the ERP. The function uses the fields specified in an Object defined in the ERP.
Syntax
=BC.WRITEBACK(
ConnectionName,
Object,
Settings,
FieldNames,
ParentObject,
ParentRecordId,
OutputFieldNames,
OutputRange,
RangeOrDataItem,
...
)
Arguments
The BC.WRITEBACK function uses the following arguments:
|
Argument |
Required/Optional |
Description |
|
|
Required |
The name of the connection as configured in the Connection Manager. This function does not support the multiple connection functionality. |
|
|
Required |
The name of the Business Central object (case insensitive). Use the BC.EXPANDOBJECTRANGE function to retrieve available values. |
|
|
Optional |
A two-column array of
Example: |
|
|
Required |
A comma-separated string
|
|
|
Optional
|
A parent object name (for example, Use the BC.EXPANDOBJECTRANGE function to retrieve available values. |
|
|
Optional (Required if |
The ID of a parent record with which the child record will be associated.
Use the BC.OBJECTDEFINITION function to retrieve information about key fields.
|
|
|
Optional |
An Excel cell range (or a comma-separated string) containing the field names to retrieve from the resulting object. Returns all fields when omitted.
This argument is ignored when in "delete" mode |
|
|
Optional
|
A reference to an Excel range where the output fields will be returned. This argument is ignored when in "delete" mode |
|
|
Required |
An Excel range with the data items or a value to be written to the first field specified in |
|
|
Optional
|
An Excel range with the data items or a value to be written to the second field specified in |
|
... |
|
|
Examples
New sales order
=BC.WRITEBACK(
A9,
B9,
C9:D10,
E9,
F9,
G9,
H9,
I9,
J9:M9)
Description:
This BC.WRITEBACK formula updates the fields orderDate, customerNumber, currencyCode, and shipToCity in the salesOrders object for the connection BC.
In the Settings argument, the API is set to common, and the Writeback mode is set to create-or-update.
The output fields are set in the OutputRange argument to be returned in the Excel range called id.
The range J9:M9 provided in the RangeorDataItem argument contains values to be written to the ERP (in the same order as in the FieldNames argument).
With references substituted by literal values, the formula translates to:
=BC.WRITEBACK(
BC,
"salesOrders",
{"api","common";"mode","create-or-update"},
"orderDate,customerNumber,currencyCode,shipToCity",
"id",
"2026-03-09,5000,GBP,London")