Document toolboxDocument toolbox

Support center for flex.bi version 4.0

How To Use Incremental Import With Rest API 2.0

How Does It Work

When importing HansaWorld data, using Rest API 2.0 connection, each data record contains an unique Sequence number. This sequence number is incrementally assigned to each data operation within HansaWorld registers, so the sequence number for a record created or altered today, is larger than a sequence number for a record created yesterday. Because of this behavior, we can use the sequence number to determine the point of the last data import end and, correspondingly, the point from which the new data has to be imported.

This allows to avoid massive data re-imports, by importing only the new and changed data.

Supported Registers

At this point this functionality is supported only for the following HansaWorld registers by default:

  • UserVc - Persons (Sales Person)
  • AccVc - Accounts
  • IVVc - Invoices
  • ORVc - Sales Orders
  • POVc - Purchase Orders
  • ItemStatusVc - Item Statuses
  • PUVc - Goods Receipts
  • SDVc - Stock Depreciations
  • ActVc - Activities
  • LocalMachineVc - Local Machines
  • IVCashVc - POS Invoices
  • SHVc - Deliveries

Read below on how to add other registers using HAL customisation

How To Enable Incremental Import

Starting from 6.0.0 flex.bi version

Edit your HanasaWorld source application and navigate to HansaWorld import options section. In both Extra dimensions and Cube properties (when using show advanced options for all cubes) tabs, there will be checkboxes available for enabling incremental import for specific registers. After the first incremental import, some of the checkboxes will automatically be deselected. This means that your HansaWorld version does not currently support the register for incremental import.

Before 6.0.0 flex.bi version 

This functionality has to be enabled for each register, and it can be done on the Update Account page of your flex.bi account.

To enable incremental import for a supported register, enter the following code in the Plan Parameters box of the Update Account page (see the figure below):

incremental_import = ["register_name_1", "register_name_2"]

In the code above, substitute register_name_1 and register_name_2 withe the names of the supported HansaWorld registers that you want to import incrementally.

You can enter any number of registers separated with a comma, enclosing each of them in double-quotes.



If you, for any reason, have enabled incremental import for an unsupported register, you will get an error message instructing you to disable incremental import for this register.

For example:

How To Enable Incremental Import Debug Mode

To enable incremental import debug mode and activate event logging in flex.bi queues log, enter the following code in the Plan Parameters box of the Update Account page :

debug_incremental_import = true

Incremental import support for other registers

In order flex.bi to be able to fetch only changes for a register, it has to have so-called synchronisation index in Standard ERP. This is why by default we support only the listed registers. However, a developer can add this index to any other register e.g. for transactions (TRVc) or item history (ItemHistVc).

Following changes require export/import of the whole database and can have implications such as slower data import and bigger database size due to the added index.

To do this add this code to halcust/datadef.hal of your Standard ERP installation:

 RecordAddBegin(TRVc,"TRVc_SynchronizationIndex");
 SynchronizationIndex;
 EndRecordAdd;