This feature requires Velixo Reports v6.1.2 or higher

Description

The WRITEBACK function sends one or more lines of values to the ERP.

The function uses the fields specified in a pre-defined Import Scenario for a specific screen in the ERP.

Syntax

WRITEBACK(Connection, ScreenID, ImportScenarioName, DataColumnNames, 
RangeOrDataItem, RangeOrDataItem1,RangeOrDataItem2, ..., RangeOrDataItem250)

Parameters

The WRITEBACK function uses the following parameters:

Parameter

Required/Optional

Description

Connection

Required

The name of the connection as configured in the Connection Manager

ScreenID

Required

The ScreenID of the ERP screen containing the data that is being sent to the ERP.

ImportScenarioName

Required

The name of the pre-defined Import Scenario that is being used to send data to the ERP.

DataColumnNames

Required

The names of the fields to which data is being written. These names must all exist in a single row on the worksheet.

OutputRange

Optional

An Excel range reference to a cell (or range of cells) for output parameters. If multiple records are expected, the range should include a row for each record.

RangeOrDataItem

Required

The first set of data to be sent to the ERP. The values to be written must be specified in the same order as the column/field names specified in the DataColumnNames parameter

RangeOrDataItem1

Optional (depending on the amount of data being written to the ERP)

An additional set of data to be sent to the ERP

...

RangeOrDataItem250

Optional (depending on the amount of data being written to the ERP)

An additional set of data to be sent to the ERP


Example

Given this configuration:

We could create this function:

=WRITEBACK("Demo", "AR303000", "ACU Import Customers", B1:O1, B2:O2, B3:O3,
B4:O4, B5:O5)

Description

We will be writing data to the screen with the ID "AR303000".

That ERP contains an active, pre-defined Import Scenario named ACU Import Customers:

To help us create our worksheet, we can use the WRITEBACKARGUMENTS function to list the name of the fields associated with that specific Import Scenario:

and then fill in the data we want to send to the specified ScreenID:

(note:  Empty values cannot be omitted if column names are specified for them in
that WRITEBACK formula. The number of values must be equal to the number of
column names. Otherwise, an error message will be shown:

Our WRITEBACK function...

=WRITEBACK("Demo", "AR303000", "ACU Import Customers", B1:O1, B2:O2, B3:O3, 
B4:O4, B5:O5)

... can then reference the data we have filled in.

  • B1:O1 references the names of the fields to which we will be sending data

  • B2:O2 references the first line of data we are sending

  • B3:O3 references the second line of data we are sending.

  • etc.

note: The WRITEBACK function does not require us to use cell references; we could
also type information directly into the function.

e.g.,
=WRITEBACK("Demo", "AR30300, "ACU Import Customers",{"TESTDEL1","First",
"[email protected]","79169224455","1-st Ave","23 bul.2","New York","US","NY",,
"LOCAL","","",""})

The WRITEBACK function also supports importing multiple entries with a single function call. Expanding on the above example, we could send two records to the ERP like this:

=WRITEBACK("Demo", "AR303000", "ACU Import Customers",{"Customer ID","Customer Name","Email","Phone 1","Address Line 1","Address Line 2","City","Country Code","State","Postal Code","Customer Class"},{"TESTDEL1","First","[email protected]","79169224455","1-st Ave","23 bul.2","New York","US", "NY",,"LOCAL","","",""},{"TESTDEL2","First","[email protected]","79169224455","1-st Ave","23 bul.2","New York","US","NY","","LOCAL"})

Note that we are sending data for both TESTDEL1 and TESTDEL2 with a single WRITEBACK function with each set of data contained within its own set of braces { }


Result

Before the data is sent to the ERP...

...the status of the function is Pending:

Once we select Import Current Worksheet, the process will start:

Once the process is complete...

... the status of the WRITEBACK function will change to Line range uploaded...

... and, within our ERP, we can visit screen AR303000 and see that the data has been imported:

Did this answer your question?