Overview
The BC.WRITEBACKJOURNAL function enables you to write lines to a specified General Journal in Business Central.
Writing back to General Journals is not available to users with the MS Dynamics 365 Team Members license.
Related articles
-
Getting started with Writeback - A general article on setting up and using writeback functions.
Syntax
=BC.WRITEBACKJOURNAL(
ConnectionName,
PostingDate,
Journal,
PostTransaction,
GlRegisterNumberOutput,
AccountType,
Account,
Amount,
DocumentNumber,
ExternalDocumentNumber,
BalancingAccountType,
BalancingAccount,
Description,
Comment,
Dimensions,
LineNumber,
OpenAfterImport
)
Arguments
This function is spill-aware. When you provide a spill range, cell range, or array for an argument, the function spills. Each spilled cell writes one journal line and shows its own status. The GlRegisterNumberOutput and Dimensions arguments don't cause a spill.
Header data
|
Argument |
Required/Optional |
Description |
|
|
Required |
The name of the connection, as specified in the Connection Manager. This function does not support the multiple connection functionality. |
|
|
Required |
The date of the transaction in the general ledger. |
|
|
Required |
The name of the General Journal. Not case-sensitive. |
|
|
Required |
Determines whether, and how, Velixo posts the journal after writeback. Possible values (not case-sensitive):
With With |
|
|
Optional |
A reference to the cell where Velixo returns the G/L register number after posting. It must be a cell reference; a value typed directly into the formula is ignored. A number is returned only when |
|
|
Optional |
The last argument of the function. Possible values:
Default value: The G/L Entries page is filtered by the document number and posting date of the first line in the batch. If a batch contains several document numbers, the page may show only the entries for the first one. |
Line data
|
Argument |
Required/Optional |
Description |
|
|
Required |
The type of the account to which the entry line will be posted.
Enter the value exactly as listed. |
|
|
Required |
The number of the account to which the entry line will be posted. |
|
|
Required |
The total amount (including VAT) in the journal line. |
|
|
Required |
A document number for the journal line. |
|
|
Optional |
An external document number for the journal line. |
|
|
Optional |
The type of balancing account.
|
|
|
Optional |
The balancing G/L Account or object ID. |
|
|
Optional |
A description of the journal line. |
|
|
Optional |
A comment on the journal line. |
|
|
Optional |
A two-column range with no header row. The first column contains the dimension code (for example, See the Using Dimensions article for more details. |
|
|
Optional |
The line number of an existing journal line to update. When you specify it, Velixo updates that line instead of adding a new one. Leave it empty, or enter |
Return value
The cell shows one of the following:
-
Pending: The formula is ready for writeback.
-
Line uploaded: The line was written to the journal.
-
An error with a message describing the problem.
How formulas are grouped
When you perform writeback, Velixo groups formulas into batches. Formulas are in the same batch when they use the same connection, journal, PostTransaction value, and posting date. Formulas that update existing lines (with a LineNumber) are always in a separate batch from formulas that add new lines. Within a batch:
-
All formulas must use the same
OpenAfterImportvalue. -
When the journal is posted, all formulas must reference the same
GlRegisterNumberOutputcell, or none.
To split formulas into separate batches, use WRITEBACKCOMMIT.
Examples
Writeback to particular dimensions
Assume the following dimension range A3:B4:
You can reference this range in your BC.WRITEBACKJOURNAL formula:
=BC.WRITEBACKJOURNAL(
"BC",
"2025-01-15",
"GENERAL",
FALSE,
,
"G/L Account",
"61100",
1500,
"INV-001",
,
,
,
"Office supplies",
,
A3:B4
)
This formula writes a journal line for account 61100 with an amount of 1500 and assigns the dimension value codes DEPARTMENT – SALES and AREA – 10 to the journal line.
You can also use an inline array instead of a cell range:
=BC.WRITEBACKJOURNAL(
"BC",
"2025-01-15",
"GENERAL",
FALSE,
,
"G/L Account",
"61100",
1500,
"INV-001",
,
,
,
"Office supplies",
,
{"DEPARTMENT","SALES";"AREA","10"}
)