Importing First Data

Almost every ClassiX module allows to upload master data with specially designed Excel files.

The module load macros are held in extra files to prevent the master modules from being overloaded with code. These modules have the same name as the master module, besides their file extension (.lod instead of .mod).

Extra files are not part of the standard project. If required, please contact ClassiX.

The directory should be structured as follows:

appswh\ [projektname] \load\*.lod

This file path has to be specified in CX_PATH in the START.bat.

Since the load macros are generalized, it is always necessary, to import the dfltrout.lod, too. It also gets included in the load directory.

 The following files are essential to import master data:

Excel import file name and path are always hard-wired in the master lod files of the macro "NameOfExcelFile". To import, the Excel file needs to be either renamed, or the file name has to be adjusted in the -lod.
 

The command "LoadObjects" in the module editing window starts the import.

Information:
In case neither the Excel file name, nor its file path shall be adjusted to the lod, it is also possible to write file name and path into the variable manualFile, before calling "LoadObjects". The load macro then uses this file instead of the hard-wired one in the lod. The load macro could look as follows:  "Y:\ClassiX\Evaluate\Kundendaten.xls" -> manualFile LoadObjects

File example - customer data:

Required files:

Excel file design and generalized macros

General:

Excel file name
Importing an Excel file, file name and path are always in the according .lod file in the macro NameOfExcelFile.

Excel file data design

Database Layer:
The Excel work sheet controls, where (in which database layer) to write the data. Work sheet 1 data (at the very left) is written into the first layer, work sheet 2 data into the second layer and so on.

Database Domains / Client Differentiation
There is another possibility to divide data inside the database layer - the domains. The lod file for general load macros (dfltrout.lod) provides a macro, which always sets the domain correctly, using 2 passed parameters - SetDomainByClass. The first parameter (Stack TOP) is expected to be the according class; the second parameter is expected to be the domain for reading and writing. 
2 CX_PARTNER SetDomainByClass would adjust the CX_PARTNER domain for reading and writing in the current layer to 2. Depending on the system data setting, this is the domain of the second client. Data that has been imported with this setting can be detected in the second client's partner mask only. 

Load Macro
The macro "InitEditObject" is called from the according .lod file after each imported row. The EditObject macro call provides a different amount of passed parameters in different modules. Therefore, it is important, to specify this ZERO EditObject statement per module with all required parameters in the lod. file.

The following examples show the principle of import interfaces:

define domain enter name sales tax. ID No industry phone save
CX_PARTNER SetDomainByClass PutValue(, name) PutValue(, vatID) PutIndustry PutDeskPhone SaveObject
1 Johansdotter & Bensemann GmbH DE71818463 019 +49-69-7050262-0 NoOperation
2 Gebr. Oevermann Fördertechnik KG DE36288778 016 +49-89-049021-0 NoOperation

 

define domain enter name sales tax ID No industry phone save
CX_PARTNER SetDomainByClass PutValue(, name) PutValue(, vatID) PutIndustry PutDeskPhone SaveObject
1 Johansdotter & Bensemann GmbH DE71818463 019 +49-69-7050262-0 NoOperation
2 Johansdotter & Bensemann GmbH DE71818463 019 +49-69-7050262-0 NoOperation
1 Gebr. Oevermann Fördertechnik KG DE36288778 016 +49-89-049021-0 NoOperation
2 Gebr. Oevermann Fördertechnik KG DE36288778 016 +49-89-049021-0 NoOperation

This way, existent Excel files can be completed quickly by the according first two rows and their columns, and be directly imported.