August 2009
Copyright © 2009 LS Retail ehf. All rights reserved. Published by LS Retail ehf.
Data Director User Guide
Contents
1 Job Scheduling / Replication .............................................................................................................. 4
1.1 About Replication ........................................................................................................................... 4
1.2 LS Retail Architecture ..................................................................................................................... 5
1.3 Methods of Replication ................................................................................................................... 9
1.3.1 Adding Replication Counter to Tables ............................................................................... 10
1.3.2 Adding Actions Generation Code to Tables ...................................................................... 10
1.4 Summary ...................................................................................................................................... 11
2 About Data Director ........................................................................................................................... 12
2.1 Modes of Data Director ................................................................................................................. 12
2.2 Concepts in Data Director ............................................................................................................ 12
2.3 Summary ...................................................................................................................................... 13
3 How Data Director Works .................................................................................................................. 14
3.1 Scheduler Database ..................................................................................................................... 14
3.2 Log Database ............................................................................................................................... 15
3.3 Package Flow ............................................................................................................................... 16
3.4 Data Distribution ........................................................................................................................... 19
3.5 Job Scheduling ............................................................................................................................. 20
3.6 Summary ...................................................................................................................................... 20
4 Setting up Data Director .................................................................................................................... 21
4.1 Prerequisites ................................................................................................................................. 21
4.1.1 General .............................................................................................................................. 21
4.1.2 Hardware ........................................................................................................................... 21
4.1.3 Software ............................................................................................................................ 21
4.1.4 Security Considerations .................................................................................................... 22
4.2 Installing the Data Director ........................................................................................................... 22
4.2.1 Installing the Microsoft Dynamics Application Objects ...................................................... 22
4.2.2 Upgrading Scheduler Objects in an Existing System ........................................................ 23
4.2.3 Installing the Microsoft Dynamics NAV database ............................................................. 23
4.2.4 Creating the NAV user accounts ....................................................................................... 24
4.2.5 Installing the Data Director ................................................................................................ 24
4.2.6 Configuring the Data Director Service ............................................................................... 26
4.2.7 Configuring the NAV Plugin ............................................................................................... 29
4.3 Managing the Data Director Service ............................................................................................ 37
4.4 Maintenance ................................................................................................................................. 39
4.5 Upgrading Data Director ............................................................................................................... 39
4.6 Troubleshooting ............................................................................................................................ 40
4.7 Summary ...................................................................................................................................... 40
5 Setting up Replication ....................................................................................................................... 41
5.1 Setting up Distribution Location .................................................................................................... 41
5.2 Setting up Scheduler Job ............................................................................................................. 44
5.3 Setting up the Scheduler .............................................................................................................. 50
5.3.1 LS Scheduling ................................................................................................................... 50
5.3.2 NAS Scheduling ................................................................................................................ 50
5.4 Replicating Objects ....................................................................................................................... 56
5.5 Replicating Files ........................................................................................................................... 58
5.6 Replication Using Transaction Server .......................................................................................... 59
5.7 Data Distribution ........................................................................................................................... 64
5.7.1 About Data Distribution ..................................................................................................... 64
5.7.2 Setting up Data Distribution ............................................................................................... 65
LS Retail ehf.
Hofdatun 2, 105 Reykjavík, Iceland
Tel: +354 414 5700 · Fax: +354 414 5710
Data Director User Guide
6 Administration .................................................................................................................................... 72
6.1 Data Director Administration......................................................................................................... 72
6.2 Troubleshooting ............................................................................................................................ 75
7 Optimizing Replication ...................................................................................................................... 80
7.1 Preload Actions ............................................................................................................................ 80
7.2 Tables to Replicate ....................................................................................................................... 80
7.3 Fields and Tables to Exclude From Replication ........................................................................... 85
7.4 Specifying General Replication Information ................................................................................. 86
7.5 LS Configuration Use Cases ........................................................................................................ 87
8 Exercise .............................................................................................................................................. 89
8.1 Exercise 1 - Replication of Items to Stores .................................................................................. 89
LS Retail ehf.
Hofdatun 2, 105 Reykjavík, Iceland
Tel: +354 414 5700 · Fax: +354 414 5710
Data Director User Guide
Overview
A Computer Database is a structured collection of data in the form of records stored in a computer
system. A computer database relies on application software to organize the data it needs to store.
It is quite possible that multiple transactional databases are maintained in disparate locations due to
reliability, accessibility, fault tolerance etc. These databases need to get consolidated into central
database for reporting purposes or vice versa, central database needs to distribute data into multiple
transactional databases. If a database can log its individual actions, it is possible to create a duplicate of
the data in real-time.
The act of inserting, updating and deleting same information in a database based on changes in another
database is called replication. Replication is a process of creating identical data records from one
database to one or more other databases.
The aim of replication is to keep copy of similar data on the same or on a different platform and
synchronize it to bring consistency. Usually, one database is the main database, or a head office, where
master data is maintained and replicated to other databases.
1. Online – Back office and POS are online with head office that is POS and back office users are
accessing head office database.
2. Online / Offline – Back office users are accessing head office database for back office transactions and
POS is having its own database for all transactions.
POS is independent
POS can use online services
Back-office has real-time data
3. Mixed store – In this architecture, few stores may be online with head office and few may be offline. POS
may be online with store server or may have its own database.
4. Standalone store – In this architecture, all the stores are accessing their local database and there is very
limited online access to head office database. Here, POS may be online with store server or may have its
own database.
All the data needs to be replicated to and from store database – which may take longer time
When any of the databases is offline, data needs to be replicated to and from that database.
The program compares data of two tables in database A and database B to find the differences
between them. It changes the data of table in database B and makes it identical to the data of
table in database A. This method may prove to be slow if there are too many records in the
tables.
The program knows before replication starts which data has been inserted, updated or deleted in
database A. The program replicates only the corresponding changes in database B.
A replication process is required to automatically replicate the changes made in one database to another.
The replication process in LS Retail has following main functionalities:
It allows replication of data between two databases.
It allows to schedule the replication of each table at user defined intervals.
It allows controlling data distribution; that is, which records are to be replicated where.
It allows configuring which fields in a table are to be replicated depending on their functionality.
It offers several methods of replication, whether replication time is important, whether there is a
need to extend replicated data from databases to POS terminals, or a simple replication, all
depending on the tables being replicated.
It allows replication of data between two databases that do not have the same table and field
structure.
Normal – In case of normal method, data is replicated between the two tables by comparing and making
them identical. It reads the records from the table (From-Table) in source database, finds the
corresponding records in the table (To-Table) in destination database, and makes them identical. If the
records in From-Table do not exist in the To-Table, the replication process adds them to the To-Table.
The replication process reads through the records in the To-Table and deletes them if they do not exist in
From-Table.
Normal replication of a table from the head office to stores leaves no trace of which records have been
deleted in the table in the stores databases. Therefore, if the POS terminals are not online in the store,
and a given table has to be replicated to the POS terminals in the store, the store's database cannot tell
the POS terminal‟s database about which records to delete. It is therefore not recommended to replicate
tables with normal method that is sent to the POS terminals.
Normal with Replication Counter – A normal replication with Replication Counter limits the number of
records replicated each time. A new field that acts as Replication Counter (datatype integer) is maintained
in the table. Replication Counter value is incremented when there is any insertion or modification in the
records of that table. The value is a number one higher than the Replication Counter value that was given
to the last record inserted or modified in the table. The data in the field Replication Counter is compared
with replication counter in last replication (This field is defined at subjob level) and the records with
greater replication counter are replicated.
This method does not support delete. Records that are deleted from a table replicated with replication
counter will not be deleted from the table in the database replicated to. The replication counter for record
being deleted from source database cannot be compared with replication counter of last replication as the
record does not exist in the source database.
If a table needs to replicate data with replication counter which has no field that is suited to act as
replication counter, a replication counter field should be added to the table.
By Actions – Whenever there is any change (insert, modify, delete or rename) in the records of a
table, the system keeps track of those changes in Preaction table. Using the By Actions method, the
system uses Preaction/Actions table to replicate data from source table to destination. The system
uses the Preaction/Actions table to send only the changes that have been made in the From-Table ID
to the To-Table ID. This method limits the number of records that need to be replicated.
If a table needs to be replicated by action having no code written to generate actions on different triggers,
code can be added to different triggers of the table.
1.4 Summary
This section explains about Data Replication and concepts of the Data Replication. Following are the
topics discussed in this section:
About Replication
LS Retail Architecture – Online, Online/Offline, Mixed Store and Standalone.
Methods of Replication – Normal, Normal with Replication Counter and By Actions.
Adding Replication Counter to a table
Adding actions generation code to tables
The Data Director is an application specialized in moving data between databases in a fast and efficient
way. It can easily move data between different databases such as NAV and MS SQL Server. Generally, if
the database supports Microsoft ADO interface, Data Director shall be able to use it. The benefit of using
Data Director is that there is no programming involved in order to replicate data.
Data Director is a flexible tool that can be adapted to a variety of data transfer scenarios.
The most commonly used configurations are for:
Moving data between the head office, stores and POS Terminals in a Microsoft Dynamics NAV based
retail organization.
Data Director – This is the regular flavor of Data Director. This mode is used to send data between
databases. This mode is non-interactive.
nd
2 Stage Data Director – This mode of Data Director is used to forward the data packages being
created by Data Director Service running in Data Director Mode.
Transaction Server – This is interactive mode of Data Director and used by POS to make queries into
remote databases.
DBServer.exe - This is the server component of the Data Director that handles requests to access
different database systems. The DBServer is run as a service on the host computer.
TransAutomClient.dll (also referred as DD Client) – This is used by LS Retail for sending queries to
the Data Director and the Transaction Server. This is the automation server being called from LS
Retail NAV to communicate with DBServer.exe.
Database Plugins - The Data Director uses a plugin to connect to different types of databases. The
plugins can be regarded as drivers that allow the Data Director to read from and write into the
different types of databases.
Package - A package contains the data being transferred between the databases. A package has a
destination Data Director and a destination database, which can be one or many, depending on how
it has been created. This essentially represents a unit of work for the Data Director.
Host Computer - The computer on which the Data Director (DBServer) service is running.
Source Database - This is the database from where data need to be read.
Destination Database - This is the database where data need to be written.
Log Database - This is the database used by Data Director to keep track of its tasks and the
packages it is currently working on.
Scheduler Database - This is the Microsoft Dynamics NAV database that contains all the details
regarding tasks that the Data Director should perform (where to send, when to send, which tables,
which fields etc.). The Data Director log and the Scheduler can also be configured to reside in the
same database.
Scheduler - The Scheduler is used for scheduling Data Director activities at predefined intervals,
such as sending sales data to head office database every hour. The Scheduler can be run either on
Microsoft Dynamics NAV client or using Microsoft Dynamics Navision Application Server (NAS).
DD - An acronym for the Data Director
2.3 Summary
This section explains about Data Director, Data Director Modes and terminology used. Following are the
topics covered in this section:
The main functionality of Data Director is to replicate data between two or more databases as efficiently
as possible. It accomplishes this by aggregating data into packages thus minimizing the amount of data
transmitted over the network. These packages are processed in a multicast like way, enabling the Data
Director to handle a very high count of end points.
The Data Director is run as a service and listens to incoming requests or packages. The DD Client is used
by LS Retail application in order to interact with the Dbserver service and tells about what to do. There
are two types of interactions: request to read data from the source database, and request to write data to
the destination database.
If the Data Director receives a read instruction, it will start by connecting to the source database using the
appropriate plugin. It then proceeds to read data from the database and stores it in a package. The
package can contain data from many different database tables.
Once the requested data is read, the Data Director has two possibilities. The first is to write the data in
the package into destination database, maybe by using another plugin. This provides an easy and
convenient way to transfer data between different databases, since the Data Director converts the data
along the way, making sure the destination database understands it.
The second option is to forward the package to one or more Data Directors. Once the package is
received by the receiving Data Director, it can proceed to write the contents of the package into one or
more destination databases.
The feature of being able to forward one package to more than one Data Director is most useful in the
retail environment where price changes or updates of some product items need to distribute to some or
all the stores. This is done automatically by the Data Director once configured, relieving the user to focus
on store operations.
The DD Client can connect to a Data Director Service running on other host computers. This makes it
easy to create a network of Data Directors that can be controlled from one central location.
In most of the cases, data would be transferred from multiple tables at a time. This data transfer would be
configured for scheduled replication. This is done by running scheduler to start the transfers, hence
named as scheduler database.
Microsoft Dynamics NAV Database Server must be running to enable an access to the scheduler
database for the Data Director. The scheduler database must contain all the application objects needed
by the Data Director.
The IncomingMessages table contains all messages or requests sent to the Data Director in question.
The information whether the data is to be sent or to receive is logged into the IncomingMessages table of
log database.
For example, a request from the DD Client for the transfer of data from the Customer table in database A
to the Customer table in database B will be written in the IncomingMessages table. When the data is read
from database A, the Data Director updates the IncomingMessages table stating that this part of the
transfer is complete.
The OutgoingMessages table contains the status of the outbound part of the transfer. Once the incoming
part of the transfer is complete (the package is generated), the Data Director can start working on the
outgoing part, which is to forward the data from database A to another Data Director or to write data into
database B. When the data package is forwarded or written into the destination database, the
OutgoingMessages table gets updated stating that the forward or write is complete.
Once the DD service receives a data package from another DD service, it updates the
IncomingMessages table and after receiving the data package, it starts writing the data into the
destination database for which DD service will update the OutgoingMessages table.
Under most circumstances, the incoming/outgoing tables are stored in the scheduler database. But the
system can also be set up in such a way that those two entities are stored in different databases. When
the incoming/outgoing tables are stored in a separate database, it is referred as a log database. It is
important to note that database A, scheduler database, and log database can all be referred to the same
database or can just be separate databases. The default settings of a DD service uses Microsoft
Access database as log database. In a production environment, it is suggested that a Microsoft
Dynamics NAV database is used as a log database which can be configured by defining the system
connection of DD service as the connection string to connect with a Microsoft Dynamics NAV database.
Following is a step by step explanation of Package Flow. For illustration purposes this process shows the
Replication of a job having Job ID as Item. (Purpose – replication of Item Master from head office to
stores)
1. The scheduler at head office detects the job with ITEM as the job ID, which is due and runs it to initiate
the DD Client to replicate the data.
2. The job is configured to replicate several tables, some by actions and some by normal with replication
counter. The DD Client is used to inform the Data Directors which records from these tables should be
added to packages. The data is divided into several packages, one for delete package and one for update
package as per distribution of By Action jobs and one for all Normal jobs. If, for example, no delete
actions are processed, no delete package is created.
3. The DD Client informs the scheduler of the package number assigned to each package. The scheduler
registers the number to the relevant scheduler log entry. In this case it will register First Package = 101
and Last Package = 103.
4. A client session on the Data Director server (the one that received the commands from the DD client)
creates a query package for each package and registers it to IncomingMessages, one for each package.
The receiver list for each package is added to OutgoingMessages, usually many receivers for each
package. In fact it is not written into the IncomingMessages and OutgoingMessages tables right away, but
added to a temporary queue where it waits for the server session to pick it up. Temporary queue is a file
which is stored in the hard disk and not in database.
5. The client session triggers its system session just before the client session exits.
6. The system session wakes up and pops up all messages from the temporary queues and registers
them into the Incoming/OutgoingMessages tables. If the system session is busy, it will turn to this after
finishing its existing tasks.
Following are the entries in IncomingMessages table before processing the packet
RemotePkg is 0 because the sender is the scheduler and not another Data Director. If the data package
is created by a DD service, RemotePkg is 0. If it is received from another DD service, RemotePkg consist
the package no. being given by the source DD Service.
Below are the entries in OutgoingMessages table at head office before the packages are processed.
Here, RemotePkg is 0 because it has not been forwarded to another Data Director yet.
DD_S01 & DD_S02 are the DD services for store 1 and store 2.
7. For each IncomingMessages entry, the query package is processed. The result is written in the data
packages and the status is changed to Processed. The relevant OutgoingMessages entries are marked
as Waiting when the data package is ready.
8. For each OutgoingMessages entry with the status Waiting, the Data Director compares the Receiver
name to its own name and further steps depend on this comparison. If the receiver is another Data
Director, the status is set as To Forward and the entry waits to be forwarded to the other Data Director. If
the receiver's name is its own name, the Data Director itself is responsible for updating the database, and
steps 9 to 13 are skipped.
9. For each OutgoingMessages entry with the status To Forward, the package is forwarded to the
relevant Data Director. The receiving Data Director returns with the local package number, which is stored
in the RemotePkg field at the sender side and the outgoing entry is marked as Forwarded.
Above is an example of OutgoingMessages entries at head office after all packages have been forwarded to all
receivers.
10. On the receiver side, the same procedure follows as the one that retrieves the commands from the
scheduler at head office which takes care of retrieving the data package. The package is registered into a
temporary queue and the system session is triggered.
11. The system session picks up all registered packages from the queue, stores them in the message
tables and goes through the entries.
12. On the incoming part, there is nothing to process since these are data packages coming from another
Data Director. Therefore, the status is set to Processed and the OutgoingMessages are marked as
Waiting.
Example of IncomingMessages on the Data Director at store 1. The Data Director Service name is DD_S01.
13. Now the destination Data Director is in same position as the head office was in step 8. It could
possibly forward the data package to the third Data Director. It is unusual to have a setup of the Data
Director like this but possible for special cases.
14. The system session goes through all OutgoingMessages and processes all Waiting packages. The
data packages are imported to destination databases and delete packages will cause the relevant records
to be deleted from the destination databases and the outgoing entries are marked as Done.
The data distribution should be one of the first configurations to be set up while setting up a new system.
The data distribution must be set up before users start entering data into the system. Data entered before
the data distribution set up may or may not be distributed correctly. Using data distribution, the data is
only sent to distribution locations that should receive it and not to any other distribution locations and
shortens the transmitting time of data by sending only the data that the destination distribution location
should receive. This can have an impact on costs related to the transmission of data.
Data distribution setups can vary between different organizations. A chain of supermarkets may need a
full setup for all tables used in the system whereas a small single location store may need a simpler
setup, since it does not have to distribute data to other stores.
In LS Retail, data is replicated using jobs. Jobs can be scheduled to run at a specified date and time. On
running the Scheduler Server, it will process scheduler jobs according to the specified given schedule.
The scheduler checks the Next Check Date and Next Check Time fields and processes the job with the
lowest date and time, even if the date and time has passed. In order to run a specific scheduler job,
priorities can be assigned to scheduler job to ensure that it may run ahead of other scheduler jobs by the
scheduler server.
3.6 Summary
This section explained the way in which Data Director works, explains the Scheduler and Log Databases,
Data Director Package Flow and the introduction of Data Distribution and Job Scheduling. Following are
the topics that were covered in this section:
How Data Director Works
Scheduler Database
Log Database – Incoming Messages and Outgoing Messages Tables
Package Flow in LS Retail – Package Creation and Package processing sequence.
About Data Distribution and Job Scheduling – Introduction about Data Distribution and Job
Scheduling.
4.1.1 General
4.1.2 Hardware
At least 32 MB of available RAM. The base process uses 5 - 30 MB of RAM for normal operation. The
amount of RAM required depends on the number of plugins DD uses.
50 MB disk space for the base application and plugins. This is the absolute minimum space required.
The additional disk space required when moving data depends on the amount of data and how
frequently it is moved. There should be at least 500 MB free space on hard drive for the temporary
data generated by the DD.
A Pentium III class processor or better. The DD is a CPU intensive application, especially when
moving data on a LAN, so that a faster processor usually means improved performance. In general,
faster the computer runs the DD, better it will perform.
4.1.3 Software
Supported Databases
MS Dynamics NAV (1.30, 2.01, 2.50, 2.60, 2.65, 3.01, 3.10, 3.60, 3.70, 4.00, 4.01, 4.02, 4.03,
5.00, 5.01, 6.00)
Note:
The 5.00 version of the cfront has a known bug where it does not release database connections
properly and accumulate temp files causing it to eventually hang. Use version 5.01 of the cfront
instead.
The DD needs 1-3 client sessions in the database it is running from for type of activity it performs. The
number of client sessions depends and may vary on the functionality used. Since the DD will be
connected to one or more databases during the operation, ensure that those databases have enough free
sessions to allow the DD to connect to them.
The databases where the DD should connect to, need to be accessible using TCP/IP.
Most data communication tools like DD need access to databases in order to move data between them.
For security purposes, DD access to the database tables should be restricted only to tables it needs to
read or write into. This is important because, unlike regular database users, the DD can effectively access
any table in a database, as it is not restricted to viewing data via a graphical user interface. By choosing
not to restrict the DD access to a database, there is a risk that users get access to data which they should
not have access to.
Most database systems allow database administrators to set up user‟s access permissions relatively
easy. It is strongly recommended to spend some time in specifying access permissions for the user
account that the DD will use to access database. For example, the Microsoft Dynamics NAV security
system provides a powerful feature that limits a user‟s access to database tables only, making the user
account useless to regular users since they do not have access to the database‟s graphic user interface.
Similar features can be found in other database systems as well. If this feature is available, it should
preferably be used for all user accounts which the DD uses.
The DD comes with a password protection mechanism that requires the user to supply the correct
password before the DD accepts any input from that user. It is strongly recommended that this feature is
enabled.
This first step requires the user to have access to a Microsoft Dynamics NAV database running on a
server. The server can be either a native server or a server using an MS SQL server as the backend. This
database will become the Scheduler and Log database. The Scheduler database contains the settings for
the Data Director to run properly.
Note 1 – This step can be skipped if you plan to use a database containing LS Retail as your
Scheduler database. LS Retail already contains the application objects required in order to run the
Data Director. However, you need to make sure that the version of the application objects in LS Retail
matches your version of the Data Director. If not, see the section below: Upgrading Scheduler Objects
in an Existing System
Note 2 – This step can be skipped if you already have a Scheduler database on your network. If you
need only the Log Database, you can import the NFMsgTables.fob file from the Data Director\Files
subdirectory once the Data Director installation is completed. You can also use the default MS Access
database as your Log Database and skip the import altogether.
The application objects are imported to the database by now. You need to make some changes to the
database in order to make the newly imported objects available from main menu. If not, you can always
run form 99001823 (Scheduler Menu) to get access to the Data Director menu.
The latest version of LS Retail should include the latest version of the Data Director objects but when new
versions of the Data Director are released, new objects are usually included in the released package.
Generally, there are no critical changes and it is sufficient to wait for the next service pack release of LS
Retail.
The Data Director packages include a standalone database which includes only the Scheduler, the
Replicator and the Data Director as parts of the LS Retail system. This database includes all objects
required to run the Scheduler and the Data Director. Most of the objects are identical to the ones in the
retail system and can be imported into the retail system without conflicts. But some objects depend on
other functionalities in the retail system and therefore, there is a need to remove those objects in the
standalone database to compile the standalone one. These objects can be identified with the CONFLICT
mark in the version list.
To upgrade an existing system with a new version of Scheduler objects, follow the below steps:
Note
Do not upgrade ‘non conflict’ objects without upgrading the ‘conflict’ ones.
Data Director requires a database which can be used as scheduler and log database which can be same
as transactional database or a separate database.
This step requires access to a Microsoft Dynamics NAV database running on a server. The server can be
either Microsoft Dynamics NAV native server or an MS SQL server. This database will become scheduler
and log database. The Scheduler database contains the settings of the Data Director to run properly.
The LS Retail database can be used as scheduler database and log database which already contains the
application objects required in order to run the Data Director. Default installation of Data Director and
configuration of DD Service uses Microsoft Office Access database as log database.
1. System account
The system account is used to access the log database. By default, the DD uses a Microsoft Access
database to keep track of the tasks it is working on. A user account does not need to be created for the
log database, if the Access database is selected for use. If the plan is to use a NAV database as log
database, you need to create a Microsoft Dynamics NAV user account that allows the DD to access the
log tables. This user only needs access to two tables in the database:
The DD must have permission to read and write into these tables. The connection string for log database
while creating DD service should contain user and password, having permission for IncomingMessages
and OutgoingMessages tables.
Accounts with super-user privileges are often used in test environments, but should never be used in a
production environment.
To install the Data Director, the DD installation file needs to be run, usually called LSRetailDDx.x.x.exe,
where x.x.x is the version number. The installation is straightforward; just follow the instructions in the
dialogs. Once installed, everything required for DD to replicate between Microsoft Dynamics NAV and MS
SQL Server databases is available since all the needed plugins are included by default.
Note
In Microsoft Vista, the user installing/configuring DD needs to have local administrative rights.
Locate the DDServer_XX.exe file in the Setup directory on the Data Director installation CD. Start the
application. Click on Yes to start the installation. The following Setup Wizard window will appear:
Select the directory where you want to install the Data Director. The default path is C:\Program Files\LS
Retail\Data Director, where user can change the path. Click on Next and the following screen will appear:
1. Open the Data Director Setting tool located in the Data Director Start menu. It is a wizard-like
interface, used to manage everything concerning the DD servers, like adding or removing
servers, starting and stopping them and configuring their parameters.
When the tool is run, the window Register Data Director Service appears, see below:
1. In the field Server Name, enter the name of the new server which by default contains the
computer name. Any name can be assigned to the server. Just make sure that the name
used will resolve to the computer‟s IP number by adding it to DNS server or the hosts file. It is
recommended that computer name should not be used as DD server name and the name
should not conflict with any other windows service running on that machine.
2. Click Add to add the server to the list called All Servers. To remove the server, select it from
the All Servers list and then click the Remove.
To Start a Server
1. Select the server from the server list and then click on Start.
To Stop a Server
1. Select the server from the server list and then click on Stop.
DD Service should not be started while defining the service. It should be started after defining all the
parameters required for that service.
Licenses
Data Director comes with a test license that can be used in a test environment, but once the DD is
deployed at the production site, it is recommended to have a valid customer license that includes the
number of subnets the site will use.
A valid license key for DD can be obtained by registering an incident at LS Retail support (LS Partner
portal). The information that must be sent is: Customer Name, Microsoft Dynamics NAV License number
as well as number of stores.
1. On Register Data Director Service, a new license can be loaded by clicking the Load
License. If the license loaded is valid, it will show DD license valid message below the Load
License.
2. Restart the DD service to activate the new license by selecting DD service from service
group.
If a simple setup is run using just one DD server, there is no need to configure anything else and you can
start the service right away by clicking Start. This will start the DD running as an NT service which will
restart automatically when the computer starts.
Note
The Start and Stop buttons will reflect the current state the selected server is in by disabling or
enabling the available action.
In the same wizard, Plugins/Controls group are available in the upper right corner having three buttons,
one for the Dynamics NAV plugin, one for the MS SQL Server plugin and one for the Client Controls.
First two buttons will be enabled or disabled according to plugins included in the license and are used to
configure the respective plugin. For example, if the license only contains the NAV plugin, the Dynamics
NAV button will be enabled and the MS SQL Server button as disabled. Since the test license includes all
available plugins, both buttons are enabled. The Client Controls is always enabled.
On click of Dynamics NAV, the screen with the options to configure NAV plugin will be shown as:
1. Click on Load NAV License to load a new NAV license which makes it available for the DD
to use. Once the license is loaded here, the Administration is used in the NAV scheduler
database to set up the distribution of the license to other DDs.
2. A license can be installed manually by putting it in the cfront plugin root folder and the version
folder that matches the version of NAV.
Following are the other parameters for the FinPlugin, that are used to access Microsoft Dynamics NAV
databases (both native and SQL).
Property Description
Codeunit Permission This specifies the codeunit in NAV from which the
plugin can inherit permissions. This can be
important in cases where there is an end-user
license and a need to replicate data into a write-
protected table such as the Item Ledger Entry.
Codeunit 99001483 contains permissions to write
into most of the write protected tables. If left as 0,
the plugin cannot write into protected tables.
Multilang. Workaround It provides a fix for an error in NAV that occurs
when the source and destination databases are not
using the same language.
Clear Illegal SQL Dates It corrects illegal dates so it can be written into NAV
date field. It only affects NAV using SQL Server as
the database.
Ignore Extra Fields If this is checked, packages will not cause an error
even if some included fields do not exist in the
destination table. They are just ignored.
Fix Decimal Precision This fixes Decimal Rounding where decimal values
may be replicated with large number of decimal
places. Type in the number of decimal values you
want to replicate in the Round To Decimal field.
Load NAV License Enables to load a new NAV license for the DDs
use.
Client Controls
The Client Controls button will open up the screen that contains the Register and Unregister buttons
which will register or unregister the ActiveX client controls that the NAV client uses to talk to the DD.
Normally, there will be no need to manually register these controls as it should be done at installation, but
under certain circumstances while upgrading the DD, the old clients might be locked when the upgrade
took place and the registration failed. If an error about missing components is reported while using the
scheduler, try to unregister and then re-register the controls using these buttons to see if it fixes the
problem.
2. DD creates three log files and will rotate through them when the Max. Lines limit has been
reached for each log. On startup, the DD will make a copy of the old logfiles by appending
.old to their names. This is useful if the DD service has been set to automatically restart on
failure – the failure will then be in the old log files.
Log Level specifies the detail level of debug information included in the Log file.Checking Error & Main
usually is enough for basic debugging, but more details might be required in some cases.
1. Log Level specifies the detail level of debug information included in the Log file. Usually the
Error and Main marks are enough but greater log detail might be required in some cases.
Note
Log level Field & Functions will produce a lot of information in a busy system and should not be left on
for long. If a log file exists, new entries will be appended to it.
Since there are various different client components used, like DD Client and Transaction Client, each
component will produce its own log file, named after the component name.
Once all the settings at Register Data Director Settings are done, click Next to move forward with
settings of DD Service.
1. The Data Director Mode drop down list configures this service instance to run as a Data
Director, a Forwarder (2nd Stage DD) or as a Transaction Server.
When the DD is running as a Transaction Server, the number in the Transaction Srv. Port field is used
for all communications.
If running as a Forwarder (2nd Stage DD), the service will only forward packages to their destinations and
will not be able to receive any packages. This means that at least one service must be running in DD
mode which will be working as package owner and one or more running in Forwarder mode. The
forwarder can be on a separate computer but make sure that the log database where the incoming and
outgoing messages tables are stored is accessible from there. The name assigned to the forwarder is the
name used in the Scheduler to indicate which forwarder should handle this location and should also be
defined in the DNS or hosts files. This name is to be given in the Forwarder field of the Distribution
Location card.
To Define Ports
1. DD Port (Port used by Data Director Service), the Telnet Port (Port used by telnet) and the
Monitor Port (Port used by Data Director monitor explained later) for the DD service can be
defined for the DD Service shown in Server Name. The values shown below are the default
values.
Note
If more than one instances of the service need to be run on the same computer, these values need to
be changed so that it should not conflict with other DD services. Please note that all the ports including
the telnet and monitor ports should be changed.
If Telnet server on the computer is run, then another port should be assigned to DD telnet interface to
avoid conflicts.
On the click of Next, Data Director Specific Properties window will be opened where a number of
properties need to be specified that affect the behavior of the DD. The following table describes these
properties in more detail.
Property Description
Server name Displays the name of the service being configured
System Connection Specifies the connection string the DD uses to connect to the Log
Database. By default, the DD installs a Microsoft Office Access database
to use as a Log Database. Dynamics NAV or MS SQL Server can also be
used but then needs to specify another connection string.
Working Directory The path to the directory that the DD uses to store temporary (package)
files.
Incoming Table The name of the table DD uses for incoming messages.
Outgoing Table The name of the table DD uses for outgoing messages.
Days Message Exist Specifies the number of days processed incoming/outgoing messages
should be kept. 0 means forever.
Timer Interval The DD checks for packages that need to be reprocessed (communication
errors) at predefined intervals. The length of that interval can be specified
here.
Limit Job Process (cnt) Limits the number of job records the DD will process per connection (to
databases or remote DDs). Using this feature can be beneficial in systems
experiencing heavy load to prevent the DD from going into a live lock. If
the first job record destined to a connection has an error, the rest of the
packages will be skipped for this run and the next connection will be
processed. This enables the DD to handle virtually an unlimited number of
waiting packages (space allowing) in linear time.
As a guideline, the number should be set low when the average package
size is high and be set higher when the average package size is low. Set
to 0 to disable (not suggested).
Below are several examples of connection strings that can be used in setup. In most cases, it is just a
matter of copying the string listed below and changing the database name, user and password.
The DD connection string consists of three sections: database specific connection string, plugin ID and a
plugin-specific string. These three parts are separated by the | symbol. Each section is configured with
parameters that can be different for each plugin and each database.
Following are few examples of connection strings. These are the strings that have been used in the past
for each plugin.
On click of Next, Data Director & Transaction Server Properties window will be shown with following
properties
Property Description
Hold Connections The number of connections to the source database that the DD should
reserve.
Idle Conn. Time Specifies the idle timeout for the reserved connections in Hold Connections.
Maximum Sessions Specifies the maximum number of simultaneous connections that the
Transaction server can use.
Session Timeout Specifies the timeout for queries involving the Transaction server.
Thread timeout Specifies the timeout for threads used in connecting to remote locations.
Max. Forw. Threads Specifies the maximum threads used when the DD is in Forwarding mode.
Max. Hop Counter Specifies the maximum number of hops a single package can take between
DDs. This prevents endless loops if the DD names are configured wrong.
Socket Timeout Specifies how long the DD will wait for the network to finish a particular send
or receive operation. Socket Timeout = 0 will disable this check. Note: This
should always be set lower than the Thread Timeout to prevent the DD
from killing itself if it is just waiting for the network.
Password The password required to get an access to the DD service remotely.
Use Processor x This is the CPU number used by DD Service.
Allow File Trans When this is checked, the DD allows transfer of files using the MonitorClient
from Dynamics NAV.
On click of Next, Server Debugging Properties window will be shown where various debug options for
the DD service can be set.
Property Description
Keep Package Files DD will not delete the temporary files in the work folder. Do not leave this on
for long time otherwise you will run out of disk space and prevent the DD from
operating correctly.
Exception Dump Creates Memory dump file if DD crashes.
Log/Dump Dir. Folder where the log files will be saved in. Make sure the folder exists.
Max Lines / Logfile DD creates three log files and will rotate through them when the Max Lines
has been reached for each log. On startup the DD will make a copy of the old
log files by appending .old to their names. This is useful if the DD service has
been set to automatically restart on failure – the failure will then be in the old
log files.
Log Level Log Level specifies the detail level of debug information included in the Log
file. Usually the Error and Main marks are enough but greater log detail might
be required in some cases.
Note
These checks should be used only for a short term for debugging purposes and do not leave these
options On for long in a production environment, especially the Keep Package Files option. Otherwise
disk space may run out and prevent the DD from operating correctly. The Log/Dump Dir should be a
directory that exists and the log mode works in the same way as the log mode for the client controls
described earlier. This is the last configuration screen of the Data Director Service configuration and
can be closed by either clicking Finish or OK.
Expand the Services and Applications branch. Select Services. Locate the LS Data Director entry. The
window will look like this:
You can now start or stop the service by clicking the relevant buttons on the toolbar or by right-clicking
the service entry. Start the service. Once the service is started, you must check whether it started
successfully. Click on the System Tools branch and expand the Event Viewer. Select the Application
branch. The window will look similar to this:
The event Viewer window will have an entry created by the Data Director. Double-click on the entry to
view its contents. The window will look something like this:
The service has already started. All subsequent messages from the Data Director service will be logged
in the Event Log.
There is also a faster way to see whether the Data Director Service is running. Open a command prompt
and enter telnet service name where service name is the name of the Data Director Service. The window
will look like this:
Here you can view the Data Director‟s status and licenses by pressing Q and L.
4.4 Maintenance
Once installed, the Data Director Service requires very little maintenance. There are few things to be kept
in mind in order to keep the service run smoothly.
Make sure that there is enough free space in the Log database. A full Log database means that
the Data Director is unable to process any packages.
If the customer wants to add new granules to license, the license needs to be updated throughout
the Data Director network. When the service is restarted, the new license will be read and the
Data Director will get access to the new granules. You simply need to put the new Microsoft
Dynamics NAV license file in the DataDirector\Plugins\FinPlugin\Incoming directory on each Data
Director on the network before restarting the service. A script can be created to simplify this task.
Once the service is restarted, the new license file will be used to access all Microsoft Dynamics
NAV databases.
If you are installing a revision within the Data Director 2.26 version, you can just re-run the installation
after having stopped all NAV and AX clients and the installed DD servers. Even if the installation warns
about removing the DD servers before you upgrade, it is safe to continue if these are not running.
Note
Please note that NAV NAS acts as a normal client and needs to be stopped to enable the re-installation
to go smoothly. If a client is running, it can hold locks on the DD client components, disallowing their
replacement and the upgrade will fail.
4.6 Troubleshooting
4.7 Summary
This section explains the Prerequisites for installing the Data Director, Hardware and Software
requirements for Data Director, Data Director Installation and service configuration. Following are the
topics covered in this section:
5 Setting up Replication
5.1 Setting up Distribution Location
In distributed architecture of LS Retail, there is a number of databases representing different locations like
head office, stores and POS. In the global network of computers, machines having source and destination
databases need to be identified which can be done by a Fixed IP address. Database server name is
mapped with an IP address using DNS server/host file (recommended is DNS).
Every database need to have its own logical and physical entity. The logical entity is represented by Store
Card. When a store is created, the program automatically creates a Distribution Location with the same
code as the store number. Distribution location is the physical address of a company in a database. It
contains the connection information of source and destination databases and company in databases for
replication. The distribution location can be created manually to represent any database like for POS. For
InStore Management module, Store No. must be same as Distribution Location code.
To open the Distribution Location Card, click LS Retail – Scheduler, Distribution Location
Distribution location has connection string which contains the connection information of the
database like server name, database name, company name, user name and password to
connect to the company of database. It also contains the DD Service for the distribution location,
database version information and network information.
Note
Company name is case specific.
It is possible to replicate data between different Microsoft Dynamics NAV versions. FinPlugin
loads the different versions of cfront.dll which are used to create connection with the databases of
corresponding version. For specific version of databases, different cfront.dll (available with
installation kit) is used to communicate. Distribution Location card need to have the
corresponding version information of the database and path for the corresponding cfront.dll
should be defined in plugin file path.
1. Browse to the distribution location for which the version needs to be specified.
2. Specify the folder where corresponding cfront.dll is available. Data Director provides different versions of
cfront.dll with installation kit. The default path for cfront is C:\Program Files\LS Retail\Data
Director\plugins\finplugin\cfront.
It is possible to replicate data between Microsoft Dynamics NAV databases that do not have the
same table and field structure. To do so, the design of the database needs to be read which is
different from the database that stores the replication jobs, that is Scheduler database. There are
two options to read the design of the database, Read Design (reads the tables and fields using
cfront) and Read Design with Data Director (reads the tables and fields using Data Director
Service). Once the design of the table at location is read, a field transfer list for replication
between different tables can be defined.
1. Click LS Retail - Scheduler, Distribution Location. The Distribution Location Card window appears.
2. Browse to the distribution location for which the design needs to be read and click Functions, Read Design.
3. A status window gives the status of the database reading. When the reading gets successfully completed,
the tables of the database can be viewed by clicking Dis.Location, Dist. Location Tables.
4. With the Data Director it is possible to read only the table design or optionally both the tables and fields. To
do so, click Functions, Read Design with Data Dir.
When there are few tables that have a different design, it is faster to just read the design of the tables and
fetch the fields only for those tables. To do so, click Dis. Location, Dist. Location Tables. Select the
table and click Table, Fetch fields v/DD.
1. Click LS Retail - Scheduler, Distribution Location. The Distribution Location Card window appears.
2. Browse to the relevant Distribution Location and click Functions, Test Connection.
3. Click Functions, Test Connection with Data Dir. Select to use the Data Director.
If the connection to the location has been set up correctly the system will prompt with a message of a
successful testing.
A distribution location can have multiple sublocations (locations within a location) like in one store, there
may be a number of POS and there may be a need to replicate data from head office to store database
as well as to POS databases. There are two different ways to replicate data from head office to store and
the POS databases of that store. One is to create a distribution location for the POS database and
replicate data from head office to store and POS. Another is to create sublocations for the POS database
under the Distribution Location card for the store and replicate data from head office to store with its
sublocations. The sublocation provides the connection information of the POS database and is similar to
a distribution location.
For running the Data Distribution, a scheduler job type must be set up, with codeunit 99001466, Data
Distribution. Select any option in the Distribution Restrictions field. Using this codeunit, data can be
replicated to a number of locations.
For running the object replication, a scheduler job type must be set up, running codeunit 99001463,
Object Distribution and select any option in the Distribution Restrictions field.
To run any Process Only Report, dataport or to run a codeunit, scheduler job type can be created
with/without defining object type and object no. If not defined at scheduler job type, object type and
object no. can be defined while defining the scheduler job.
Another way to insert default Scheduler Job Types is to insert default data from the Retail Setup.
Scheduler Subjob
The Scheduler Subjob contains information about tables and fields that need to be defined to replicate
between databases in a scheduler database. A scheduler database may exist within the source database
or destination database or may be a separate database. The Scheduler database is the database
containing complete information required for replication, such as distribution locations, tables to replicate,
information of source and destination database. The Scheduler Subjob is used to define information
necessary for replication, such as tables to replicate and the replication method.
Note
If the design of a table in the source and destination database is different, then From-Location Design
and To-Location Design must be defined with transfer field list. If there is no difference in table design,
from and to-location field can be left blank and there is no need to define Transfer Field list which
means all the fields will be replicated from the Source table to the Destination table.
The Replication Method is selected mainly by the type of table that needs to be replicated. The
Replication Method Normal with replication counter does not support delete action, so it should not be
used with master tables since master tables can have a delete action. Normal with Replication counter
can be used with transactional tables because these tables do not have delete action. Master tables
should be replicated with the By Action method. Setup tables will not be replicated very frequently and will
not have a high number of records so they can be replicated by Normal method.
Linking Tables
Tables can be linked to replicate data with main tables using the Linked Tables option from the Subjob
button and link between main table and linked tables can also be defined. For example – transaction
entries tables can be linked with the Transaction header table. Once the linked tables are defined, the
checkbox Linked Tables Exist will be automatically enabled.
Applying Filters
Filters can also be applied on the data to be replicated between databases using From-Table Filters
options. Once the filters are defined, the checkbox From/To Table Filters will be automatically enabled.
Defining What To Do
This field What to do specifies what the replicator should do when updating data in the To-Table ID field.
This field only applies if the Replication Method is Normal. If the replication method is By Actions, this field
is not relevant. In the lateral case, the Action field in the Actions table contains the information about what
to do.
Note
It is extremely important to select the right option in this field. For example, it is safer to use the Add-
Only option when replicating entries from store to head office than using the Add option. The reason is
that if the number series for the records being replicated, overlap for two distribution locations, the Add-
Only option will return an error, while the Add option will not.
Normal with Replication Counter supports only the Add, Add-only and Update-Add methods.
Scheduler Job
The Scheduler Job is the key to Data Replication. Scheduler Job is used to define the what, how, where,
when of replication. Scheduler Jobs are used to define activities to be run at periodic intervals. It can be
report, codeunit, batch but most importantly to replicate table data between locations. These Jobs can run
at predefined intervals in the scheduler or on click of Run Now.
Object type and Object Number must be defined at Scheduler Job. Object type and Object No. are filled
in on selection of scheduler job type and can be modified at Scheduler Job. On running the scheduler job,
the object will run. Object type can be report, dataport or codeunit.
Error Handling
This field provides the options how the Scheduler should handle errors that occurred while running the
job. There are three options:
1. Skip To Next Run: The program will skip running the scheduler job till the next time it should be run
(according to the time interval),
2. Mark With Error and Retry: The program will mark the scheduler job with error and retry data exchange.
3. Mark With Error and Stop: The program will mark the scheduler job with error and stop running it.
Sublocations Restrictions
While replicating data, sublocations of distribution location being defined in To-Locations should be
included in replication or not can be defined using Distribution Sublocations field at Scheduler Job. It
has three options:
1. Excluded from Replic.: Distribution Sublocations (POS terminals) are not included when running the
scheduler job.
2. Included in Replic.: Distribution Sublocations (POS terminals) are included when running the scheduler job.
3. Only Included in Replic.: Only Distribution Sublocations (POS terminals) are included when running the
scheduler job, not the Location (store) they are located in.
The Scheduler runs scheduler jobs according to the next scheduled date and time of the job. The priority
rules are as follows:
1. Scheduler jobs with the Run Status Special Order have first priority. These are jobs that are processed by
the function Order Run of Scheduler Job from the Scheduler.
2. Scheduler jobs that have the Run Status With Error or Stopped with Error have second priority. These are
jobs that are run with errors. The scheduler tries to process these jobs every other time.
In each process, the Scheduler will run one scheduler job of first priority, one of second priority and then
one job with a blank option as a Run Status.
One is LS Scheduler for which a form (Scheduler Server) needs to be kept in run status which will check
for the jobs to run and another is using Navision Application Server which is run as a windows service
and will check for the scheduler jobs to run and will run those jobs.
5.3.1 LS Scheduling
The Scheduler Server window is used to set up and start the scheduler server if the server is to run
scheduler jobs.
1. If a number of replicators are used, the load of replication jobs can be distributed between the replicators.
While setting up a number of replicators, it is easy to set up the Scheduler for one replicator, as one
scheduler job type should be created for each replicator and assign the job types to scheduler jobs in the
scheduler. One scheduler job type should be assigned to each scheduler server. If no scheduler job type is
assigned to scheduler server, it will replicate all the scheduled jobs.
2. The Scheduler combines all scheduler jobs in the system, whether they are replication jobs or
miscellaneous.
How the scheduler jobs are processed can be viewed in Scheduler. Whether the jobs are run successfully
or any error has returned, can be checked from Scheduler Log option in Server.
Navision application server (NAS) comes with Microsoft Dynamics NAV installer. To schedule jobs using
NAS, first of all NAS need to be installed on the system on which scheduler should run. While installing
NAS, a name should be assigned to the server which will be used for Microsoft Dynamics NAV Database
Server and SQL Server for Microsoft Dynamics NAV.
After installation, using NAS Service manager (it can be done using Microsoft management console),
one snap-in should be created for NAS Service where as host name should be the computer name where
NAS is installed and Service name should be the same name being defined while installing NAS.
FIGURE 5.3.2 -1
FIGURE 5.3.2 -2
Enter the host name as localhost and Service name as NASNAV or NASNAVSQL being defined for NAS
service. If there is a need to connect with NAV database server, take NASNAV and for SQL database,
take NASNAVSQ.
Property Value
Database Server Name NAV Server name or SQL Server name
Database name (If NAV server is directly connected with database, then it
Database
is not required). In case of SQL need to define database name.
Company Name Name of the company in database
LSRSCHEDULER DD_Server,Typefilter=DD,Log=1
DD_Server is the service name of Data Director and typefilter is the
Setup parameter
scheduler job type. If typefilter is left blank, it will include all scheduler job
type.
Net Type TCP/IP in case of NAV and Default in case of SQL
Object Cache Size Default value will be 8000 and can be changed.
FIGURE 5.3.2 -3
FIGURE 5.3.2 -3
FIGURE 5.3.2 -4
Note
NAS service should run in network account. In windows service utility, On Logon tab, Logon account
should be network account.
FIGURE 5.3.2-5
Now start the NAS Service – NASNAV and it will start the replication of scheduled jobs.
Since NAS is running as a windows service, it will continuously check for the scheduler jobs to run and
will run the corresponding jobs. This service will only run the jobs having scheduler job type being defined
in typefilter of Setup Parameter and will run using the DD Service being defined in Setup Parameter.
Microsoft Dynamics NAV contains three types of tables: – data tables, system tables and application
object table. System tables cannot be replicated but the other two types of tables can. Replication of data
tables is the regular data replication as discussed. The Object table is just a regular table which contains
the application objects as a BLOB field. This means that the replication can be done if required
permissions are available. Objects are stored in a system table 2000000001 (Object). Object replication is
basically handled as replication of data from table 2000000001.
Scheduler job should be created with the Job Type Object Replication. The Job should use the object
type Codeunit and object number 99001463 (Object distribution).
Object Transfer Header in the LS Scheduler module is used to define the objects to transfer between
databases. Job ID should be defined in object transfer header which will be used to replicate objects. In
object transfer lines, different objects to replicate need to be defined.
After defining the objects transfer, it should be confirmed using Confirm Object Transfer in Functions or
by pressing F11.
Note
Object Transfer using this method works only with the Data Director.
Limitations - Object replication is technically similar to importing text files and run into the same
limitations:
Cannot create new Dynamics NAV standard fields/objects
Cannot change permissions to objects which don’t have access to (for example -Codeunit 22)
End user licenses cannot create new objects, add fields or modify permissions. This makes the end
user licenses a bit annoying.
Resolution
The Allow File Transfer field should be check marked on DD service configuration. After checking the
Allow File Transfer, DD Service should be restarted. This field allows file transfer to a remote PC running
the Data Director.
This allows transferring a developer‟s license to the remote location to update objects and switch back to
the end-user license when the transfer is complete.
Note
Any file can be transferred using this method. This can be a security risk.
To Transfer File
File transfer can be done manually using the Data Director Administration Setup. Same can be done
automatically by running the DD File Transfer codeunit (99001465)
Advantage can be taken of the #DD_HOME variable to point to the DD installation folder
DD_HOME#\Plugins\FinPlugin\Incoming\fin.flf
To achieve the same, scheduler job can be created with object type as codeunit and object no. 99001465
with job type as custom.
Example
To replicate a license file, path of license file for source and destination location can be mentioned in
Text field on object setup tab of Scheduler Job like:
SRC=c:\temp\fin.flf,DEST=#DD_HOME\Plugins\FinPlugin\Incoming\fin.flf
This method is used to place the file fin.flf in the Incoming folder of the FinPlugin. When the DD starts
processing a job, it will look in this location for a new license to use. This can be done manually. The
same method can be used to switch back to the end-user license.
Transaction server is a different mode of Data Director which is interactive. When running in Transaction
Server mode, the Data Director behaves differently from the regular Data Director mode. In Transaction
Server mode, the functionality is greatly reduced and a log database is not required.
The Transaction server works as a service which reads the data from source database and takes that
data to the destination database; creates the connection with destination database and writes the data
into destination database. Using transaction server, it is not possible to have different services to read
data from source database and write data into destination database.
The Transaction server does not create packages of data and this is the reason why the transaction
server does not use a log database to keep track of data packages.
The Transaction server is an interactive mode of Data Director which can make queries to remote
database and can get the results. Transaction server is able to send data to remote database. The main
reason for running the Data Director in Transaction Server mode is to allow the LS Retail POS to
communicate with remote databases. This allows the POS Terminals to look up the data such as
customer balance and stock availability from a central database.
The Transaction Server allows the LS POS to make queries to the Back Office database when the LS
POS is configured to run offline.
Before the transaction server functionality can be activated on the POS, LS Data Director service is
required to run in transaction server mode on the same network. The Transaction Server can also be
used over a Wide Area Network (WAN) but the performance will be slower. It can be used for special
queries.
If at any point of time, the transaction server service is not working, the information of the transactions
which are to be sent to a remote database is kept in the source database in table 99001615 – Trans.
Server Work Table. When the connection is re-established using the transaction server service with a
remote database, it will send the pending transactions to the remote database first. For example - When
the user logs on the POS or posts any transaction and finds the transaction server working, pending data
will be sent to remote database.
For example – in the below diagram, there are two transaction servers (TSs) added; one at the central
database and one at the Navision node.
Navision
DD DD
Central
MS SQL
DD Client OCX
Scheduler
LS POS.Net
LS Retail
TS
TS
DD
Navision
DD Client
LS Retail
POS
DD: Data Director DD Client
TS : Transaction Server OCX
Scheduler
LS Retail
FIGURE 5.6 -1: TRANSACTION SERVER ARCHITECTURE
In this example, the LS Retail system at the node (may be POS or store) can open up a connection to the
central database and make queries as if the central database was local to it. This has an advantage of
being faster than to connect remotely using the normal Microsoft Dynamics NAV method. Similarly, all
POSs connect to the local database through the TS saving the concurrent number of users which need to
be available since the TS handles all the requests through one connection.
Whenever immediate online information is needed or needs to be updated, the TS should be used.
Different options for selecting the type of transactions and the remote server with which the transaction
server should communicate are defined in the table below.
To activate a function, place a check mark in front of the relevant line and select a distribution location
that contains all the necessary connection parameters that the Transaction Server requires in order to
process the request. The distribution location is the remote server to which that type of query should be
made.
Note
This must be done on each POS (if the POS is offline) that will use the Transaction Server, and
distribution location for the remote database should be defined with distribution server as transaction
server service.
Transaction
Description
type
At the end of a sale, when a transaction is posted to the POS database, it is also
pushed to the remote database defined in the send transaction server.
If the remote database is unavailable, the transaction will only be stored in the
Send
POS database. When the remote database becomes available, all unsent
Transaction
transactions will be sent at once. Please note that the system does not detect
when the remote database becomes available. This will be triggered when
connection will be created with remote database using transaction server.
At the end of voiding the transaction, transaction is posted to the POS database; it
Void Posted
is also pushed to the remote database being defined in void posted transaction
Transaction
server database.
Suspend - When the suspend button is pressed on the POS, the POS
Transactions and related lines are sent to the specified remote database.
After selecting a specific POS Transaction from the list, the whole transaction is
requested from the server. If successful, the transaction is deleted from the
Suspend - remote database. The transaction is now only available on the POS and can be
Retrieve finalized, suspended again, etc.
Transactions
If it is not possible to suspend the transaction to a remote database, the POS will
suspend it locally.
If it is not possible to retrieve the transaction from the remote database, the POS
will display an error. There can be two reasons for this. One is that the suspended
transaction is stored in the remote database and cannot be retrieved. In this case
the customer has no other option than to rescan the items. The second reason is
that the POS that suspended the transaction was unable to store it in the remote
database. In this case the customer must return to the POS Terminal where the
transaction was last suspended in order to retrieve it.
The cashier selects the customer to check. The POS sends a request for the
updated status of the customer. The results of this query are written to the POS
database. From here, the transaction proceeds normally. If the customer is
blocked or has exceeded his balance, the standard POS application will take the
appropriate action.
Customer
Since this is a query to the remote database, error handling is rather simple. If the
remote database is unavailable, the POS will use the values stored in the POS
database.
After finishing the sale, an attempt is made to send the entry to the remote
database. If the attempt fails, the Replication Counter is used to mark the entry.
Data Entries
Otherwise, if there are previous entries which could not be sent, an attempt is
made to send them. If successful, the Replication Counter is set to 0 (zero).
Apply-The Transaction Server attempts to fetch the entry from the server. If
successful, the entry is marked with the terminal number and sent back to the
remote database (to prevent others from being able to apply it during the sale). If
unsuccessful an error is displayed, and the user is prompted to either retry, or
abort. A user with manager privileges or with the value Continue on TS Error set
in the Staff card retries and the attempt fails again the entry is accepted. An entry
is inserted into the POS's local database where amount is set to 0, and the
applied amount is the amount entered.
If the entry on the server was already reserved by another POS, an error is
displayed. A manager is able to circumvent this error.
After posting the sale, an attempt is made to send the entry (same as above). If
the entry has 0 in the amount field, the entry is read from the server, and the
Original Amount value is added to the entry.
If the update is unsuccessful, the entry is handled in the same way as in (a).
The POS sends a request to the Transaction Server, asking for the status of the
staff member. The Transaction Server copies the corresponding staff record to the
POS database. Once the staff record has been copied, the POS application will
Staff
process the data locally. The POS application will first check whether the staff
validation
member is blocked. If so, the staff member cannot log on to the POS.
If the POS is unable to get answers from the Transaction Server, the POS uses
the Staff information in its local database to determine whether logon is allowed or
not.
Floating The POS sends a request to the Transaction Server, asking for the status of the
Cashier floating cashier.
This field is used to get Inventory Lookup with Transaction Server.
The command in question does not work in the normal sales menu. It only works
Inventory in the lookup menu, and only so when an Item lookup or Variant lookup is done.
Lookup One thing need to make sure that a special Lookup table is updated for this
purpose in the head office Database (or the one where the query will be made).
For which product groups the Lookup should work need to be specified and after
doing so, it need to be enabled for each store. This will trigger an update on the
table Lookup table.
The Lookup table should be updated regularly, either manually or automatically
(from the Scheduler), at least each time a new Item, or store is added.
A check mark in this field indicates that the system will use the Transaction Server
Login Staff and the location in field Login Staff for login/logout from POS in the Time
Registration Module.
A check mark in this field means that the Transaction Server Serial Number check
Serial No.
is enabled for this POS. Transaction server will check for the validity of the serial
Check
number entered at POS in the remote database.
This field contains the ID of the distribution location to or from which Loyalty points
Loyalty are sent. If this field is enabled, it means that the loyalty points will be sent using
transaction server to remote database.
A check mark in this field means that the Online Transaction Backup is in use for
Online Trans. this POS. Transaction server will keep the backup of transactions using
Backup transaction server in remote database being mentioned in “online trans. Backup
server”.
POS Cash A check mark in this field means that the information required for cash
Mgt management is retrieved from remote database server using transaction server.
1. Table Distribution. This is used to specify the Data Distribution type used for individual tables in the
system.
2. Distribution Groups. This is used to specify how stores and POS as well as other Distribution Locations
are grouped together. A distribution group can be created for each city the stores are in or distribution
groups for chains of stores.
3. Distribution Locations. A Distribution Location is a place to define the connection parameter of a database.
By default, these are the head office, stores and POS terminals or other databases as well. To send data
into or read data from database, a setup needs to define parameter like the Database Server, access
information, the network connection and other related information.
4. Distribution List. This is used to define where individual records are distributed.
The Data Distribution should be one of the first things to be set up while setting up a new system. The
distribution must be set up before users start entering data into the system. Data entered before the
distribution is set up may or may not be distributed correctly.
Distribution setups can vary from one organization to the other. A chain of supermarkets would probably
need a full setup for all tables used in the system. A small single location store would need a simpler
setup, since it does not have to distribute data to other stores. For example - Distribution for an Item on
change of description of item.
The system detects that a change is made to a record in the Item table. The system writes an entry in the
Preaction table (code is written to generate entry in Preaction table in different triggers of Item table),
stating the ID of the record, the number of the table (the Item table is number 27) and that the change
was in the form of an update to an existing record.
The PreAction->Action (99001560) codeunit is run. The codeunit will see that a change has been made to
a record in the Item table from Preaction table. The codeunit will look at the Table Distribution for the Item
table, to find out how the Item table should be distributed. Depending on the table distribution, the
program will find how the record should be distributed.
Once the distribution of the record is found, the program will insert entries into the Actions table for each
distribution group and subgroup that the record has.
The whole idea behind the table distribution, the groups and the actions is to have a simple way to find
out which data should go where. The concepts related to distribution may seem complicated, but there is
no need to worry. Once the distribution has been set up, it requires almost no maintenance or intervention
on the user‟s behalf.
Just as store groups need to be defined in LS Retail, distribution groups also need to be defined in the
system for the distribution of data. Store group is the logical grouping of stores and distribution group is
the grouping of the distribution locations for replication. Distribution groups are used to group stores
together. By grouping stores the task of assigning distribution to records become easier, since there is no
need to specify the distribution for each store, only for a group of stores.
Distribution groups are similar to mailgroups. Once the mailgroup is created, recipients can be assigned
to it. The same goes for distribution groups, but instead of assigning recipients stores are assigned.
To distribute data, it is very important to decide the grouping of stores on the basis of data distribution. A
store group consists of a distribution group and subgroup. The group can have one or more subgroups.
Stores can be assigned only to one distribution group, but these can be members of many subgroups.
Store Group
The Store Group table is used to set up store groups. Store groups are used to group together stores
based on some common characteristics, such as size, location, and product range. This allows various
common settings to be defined for a group of stores instead of for individual store. This applies to
connecting stores to Distribution Groups, Inventory Management distribution and so on. Store group can
be mapped with distribution group or with subgroup of any distribution group.
When starting to use of LS Retail and before starting data entry in the program, it is necessary to create
one store group that includes all stores. One store group can be created marked No Filter. This store
group is then connected to its corresponding Distribution Group.
Example
ACME Inc. runs a chain of hardware stores. ACME has stores in Washington, New York, Seattle, Los
Angeles and San Francisco. Distribution groups for ACME need to be created.
A distribution group named ACME can be created. Within that group create two subgroups, EAST and
WEST. Once these are created assign the stores to group ACME. Furthermore, assign the Washington
and New York stores to subgroup EAST and the Seattle, San Francisco and Los Angeles stores to
group WEST.
Now data can be distributed to New York and Washington store by selecting group ACME and
subgroup EAST (ACME->EAST). ACME->WEST can be used to distribute data to Los Angeles, San
Francisco and Seattle.
Data can be distributed to all the stores by selecting group ACME and no subgroup.
If data need to be distributed to one store only - Seattle, select ACME->SEATTLE.
Create subgroups NORTH and SOUTH, and assigned stores to them. These groups can coexist with
subgroups EAST and WEST because there is no limit on the number of subgroups within a group. The
same goes for the stores (or members). These can be members of many subgroups but only one
group.
This selection method is used when distributing data with the distribution list. Once the record to be
distributed is selected, simply fill in the values for the group and subgroup.
The system expects one group to represent all stores within the organization. This group should have one
subgroup as well. These groups are usually named All and referred to by All->All. This group and
subgroup are a part of the default values for LS Retail.
Actions and Preactions stand for entries in Action and Preaction tables. The purpose of these tables is to:
Keep track of changes made to data in LS Retail.
Keep track of how the changes should be distributed.
The difference between these tables is that the Preaction table only knows which data has changed. The
Action table knows which data has been changed and also how it should be distributed.
Every time a user changes data in LS Retail, a log of the changes is written to the Preaction table.
Change means creation; updating or deletion of a table in LS Retail is logged in the Preaction table. This
allows the system to keep track of which records have been changed and when.
Note
The system knows only which record has changed. It does not know which fields in the record have
been changed.
The Preaction table tells which records have changed. But there is need to know how the changed
records should be distributed. Should they be sent to all stores or just a single store? In order to find this
out, Preactions need to be converted into Actions. This is done by running the codeunit PreAction->Action
(99001560). By running this codeunit, the system will convert all Preactions to Actions, giving a list of all
changed records in the system and also telling how they should be distributed. System keeps the track of
preactions being converted into actions in Action Counters table. On the basis of value in this table, it
converts only new generated preactions into actions.
Note:
Scheduler job can be created By Action method with Action Table ID as Preaction or Action table, if
Preaction table ID is set in Action table id, data will be replicated to all the locations being defined in
include list or to stores in store group being defined in receiver group at scheduler job because
Preaction table is having the information of records being modified but does not contain the distribution
information. To distribute data location wise, Scheduler Job must be created with Action table in Action
Table ID.
While creating a new scheduler subjob using the method By Action will be created with action table id as
preaction or action depending on the value in Replicate using Preaction in Scheduler Setup. If this field
is check marked, the subjob with the method By action will be created with the Action Table ID as
Preaction and otherwise Action. Action table ID can be changed manually.
Table Distribution controls how individual tables in the system are distributed. Note that the table
distribution says nothing about where the tables are distributed, only how they are distributed.
LS Retail consists of many different tables, which serve different purposes. How to distribute a table
depends on the functionality of the table. For example, the Gen. Product Posting Group table is a table
that should be distributed to all locations. The Item table might have a more selective distribution,
depending on the selection of items in the stores. Records in the Store table should only be distributed to
the store it represents. These three tables would have a different Table Distribution, since their
distribution follows different principles.
The Table Distribution is closely linked to the Distribution list. The table distribution is a setup table
where the type of distribution of different tables is defined whereas in Distribution List the records are
created for replication of records of tables on the basis of Table Distribution setup. When there is any
insertion, modification or deletion of record in a table, data is entered in Distribution list table which tell the
system how to replicate this record.
The Distribution list is used to tell the system how individual records should be distributed. Note the
difference between Table Distribution, which dictates how tables are distributed, and Distribution List,
which dictates how records are distributed. The Distribution List is used only where to specify distribution
based on records.
All - This option tells the system that the table should be distributed to all locations. The distribution list for
this table will be empty, since the system can find out the distribution for all records in the table by looking
at the Table Distribution.
In the example above, the Gen. Product Posting Group table should have table distribution type All.
Specific - This option tells the system to specify distribution on record level. In this case, the user has to
fill in the distribution list manually for each record in the table.
In the example taken above, store table should have table distribution type Specific.
By Master Only - This option allows to link tables together. In many cases, it can be convenient to link
the distribution of one table to another.
For example, if Items and Barcodes for the items should have the same distribution, then the Barcode
table can be linked to the Item table so that all barcodes related to an item will get the same distribution
as the Item. This is a very powerful feature because it allows the user to link many tables together and
only specify the distribution on the top level. This kind of distribution is used in the default settings that
come with the system.
When By Master Only is used, the user must define the link between the tables. This is done through the
Table Links field in the Table Distribution window. In our previous example the Barcode table would be
linked to the Item table by linking the Item No. field in the Barcode table to the No. field in the Item table.
Some kind of relation must exist between the tables when this option is used. This option cannot be used
if there is no logical relation between the tables and tables cannot be linked by this method. For example
–the Item table cannot be linked with the Customer table, since there is no direct table relation between
those two tables.
While linking tables, it is preferable that the linked fields are parts of the primary keys of the linked tables.
This is not absolutely necessary, but will improve the performance of the system a lot.
Table Default - This option is reserved for four tables in the system:
Price Group
Store Ordering Information
Shelf Label Setup
Item Label Setup
The user is advised not to change the distribution of these tables. This distribution option cannot be used
for other tables in the system.
No Distribution - This option means that the table will not be distributed. Actions for this table will not be
created.
All Default - This option is a combination of All and Specific. When a record is created for a table with
the distribution type All Default, the system will create a distribution list entry that tells the system that the
record should be distributed to all locations. However, the user can modify the distribution for the record
afterwards.
The different types of table distribution are listed. How to create groups of stores for distribution and how
to assign distribution to records with the distribution list has been discussed in distribution group.
The system comes with a predefined Table Distribution that should be appropriate for most organizations.
Changes to the default table distribution settings should only be done by advanced users.
When there is any change in master table and action is generated for record in master table, then action
can be automatically generated for linked tables by clicking on Actions on Linked Tables, Linked
actions on Insert, Linked actions on Modify and Linked actions on Delete. For example – with
default distribution setup, action can be created for barcode or variant table on action creation for item
table records.
Location Distribution
To distribute data location-wise, distribution location, distribution group or store group need to specify with
every record. Store group or distribution group are again mapped with distribution location. This linking
can be done using the setup defined in Table Distribution Setup. For example – While creating a new
item, price group can be attached with that item. Price group is further linked with Store group and store
group is mapped with distribution location through distribution group and distribution subgroup. System
creates actions using this mapping for the corresponding locations/distribution group and distribution
subgroup.
If there is need to define distribution location for each and every record separately, the Location
Distribution can be used. Location Distribution is used to set up and/or view distribution setup for a
record in a specific table. For example - view distribution for a specific item or a price group in this
window.
Distribution affects the system by dictating the replication of data from one Distribution Location to
another while replicating with the replication method By Actions. When replicating to a location, the
replication process looks only at actions for a record that has Location Distribution that includes the
location being replicated to. The process checks whether the Location Group Filter of the action is a part
of the Distribution Group Code for the Scheduler job and accordingly replicates the data.
If the table's Distribution Type is All Default, Master Default or Table Default, the program creates
default distribution for the record after it is inserted and necessary fields are filled in the record. It creates
an entry or entries in this table for the table record, depending on the table's distribution type. The default
distribution for the record can be changed. If the distribution type is Specific, specific distribution for the
record should be defined; the program does not create any distribution automatically.
If the table's distribution type is All or By Master Only, the program also creates an appropriate
distribution for the record in the table. This distribution cannot be changed here.
Note
No record can be entered into the Distribution List table if the table involved has no entry in the
Distribution Setup table or if its distribution type in the setup is All, By Master Only or No Distribution.
When an entry is created in Location Distribution table, the program creates an Action with Table No.
as the Table ID and Primary Key as Value. The Action's Location Group Filter is the Distribution Group
Code and Distribution Subgroup Code combined.
When an entry from the Location Distribution table is deleted, the program creates a Delete action in the
same way as above.
When an entry is added or deleted in the Distribution List table for a table that is the Master Table ID for
other tables which have the Distribution Type By Master Only or Master Default, the program performs
the same changes to the Distribution List entries for these tables. The field Default Distr. Chg. Mess in
the Scheduler Setup table controls whether the program shows a confirmation message window when
changing the distribution of a table with the Distribution Type Master Default.
When the distribution type is By Master Only, the program performs exactly the same changes as the
location distribution needs to be the same for the Master table and the tables underneath.
The purpose of this field is to be a reminder of the location distribution structure chosen, when starting to
use the system. It is not practical to have this field marked in a large database where location distribution
of the type Master Default is used.
Be aware of the consequences of deleting an entry in the Distribution List table for an item. If data is
replicated from head office to stores, deleting a distribution list entry causes the deletion of the item in the
databases of all locations included in that location distribution list. If the item has already been sold in the
store, that is, transactions and/or ledger entries exist for the item, blocking the item can be considered in
the store instead of changing its distribution. Otherwise the replication process deletes the item and leave
entries behind for a non-existing item. If not replicating data, changing location distribution on sold items
does not cause problems.
Troubleshooting
The test connection for distribution location of source and destination should be successful for replication
of data.
If data needs to be distributed location wise, scheduler subjob must have the replication method as “By
Action” and Action Table ID must be Action. If the scheduler subjob is created with the action table id as
Preaction, then data will be replicated to all locations being defined in include list/receiver group.
If the structure of source and destination tables is different, design must be read for the distribution
locations and also the transfer field list must be defined with From and To-Location.
In production installations, it is suggested that a Microsoft Dynamics NAV database should be used for
log database.
Scheduler subjobs with different replication methods (Normal and By Action) should not be mixed in one
scheduler job. Different jobs should be created for scheduler subjobs with different replication methods.
This improves the performance.
Sometimes it is important to control in which order tables are locked at the destination site to prevent
deadlock situation or in which order tables are read from the database and also in which order they are
updated on the destination sites.
The Lock Seq. field should be used to define the sequence number of the subjob in the Scheduler Job
Line.
Note
This column is not visible by default. The Show Column option must be used to make it visible.
The user running LS Scheduler/NAS Scheduler should have the required permission to run different
scheduler jobs.
The Scheduler job should have the scheduling time interval set.
The Navision Application Server should be run with network user account and same network user should
be created in Microsoft Dynamics NAV database at same location.
While creating a scheduler subjob for a table in which there will always be very high number of records,
then to decrease the size of packet, Action counter interval and Repl. Counter Interval field should be
used in case of action or normal with replication counter. For example – if a table consists of 1,000,000
records and this table is replicated using normal with replication counter, the size of packet will be very
big and will take time in replication. The same can be achieved by defining Repl. Counter Interval as
10000.
If data of a table is replicated from source location to destination location database using the By Action
method and further if there is need to replicate data from destination database to further more destination
databases using By Action method, then the Move Action field should be check marked in the
scheduler subjob for that table so that the system will move actions/preactions according to Action table
ID. For example – To replicate data from head office to stores databases Move Actions should be check
marked if data is to be sent from stores to POS databases using the By Actions method.
The Uses Scheduler Job Record field at scheduler job should not be ticked if a job is not replicating
data or the job is process only like to run any codeunit, report or dataport.
Summary
This section explains how to set up Data Replication in Microsoft Dynamics NAV. For setting up
replication you need to set up Scheduler Job Types, Scheduler Subjob and Scheduler Job.
Replication can be scheduled either by LS Retail scheduler or Navision Application Server (NAS). The
user can also replicate the Objects and Files (License). This section also explains store group wise
replication. Following are the topics covered in this section:
6 Administration
Data Director is used to replicate data between different locations. Data Director replicates data in
packages. Packages need to be tracked and if data is not delivered to destination successfully, there is a
need to find out the status of a package and reason of the problem if any.
Data Director Monitor is used to view the usage of the Data Director Service or what the service is doing
at present. With the help of the monitor, the user can view which package is currently being processed by
the Data Director Service. The user can view the usage of one service at a time using Data Director
monitor. The Data Director Monitor creates a stack of the activities being done by a particular Data
Director Service.
The Data Director Monitor can be run from Data Director Administration in the LS Retail Scheduler
menu, where the Data Director Service name and the monitor port can be defined in server info (Server
and Port) fields. Click on the Connection on/off button to view the workings of the Data Director Service.
This tool will just provide the to-do list of the DD Service after running that form. It cannot keep track of
the complete history of jobs being done by Data Director Service and will provide only the list of activities
which DD service has done after running the monitor form.
Data Director replicates data in the form of packages and the system maintains the complete track of
packages in the Log database as explained in Package Flow. The source Data Director Service keeps
track of packages being forwarded in its Log database. In the same way, the receiver Data Director
Service keeps track of packages being received in its own log database. In production environment, it is
very difficult to track packages in different databases at remote locations. For example - If there are more
than 100 stores, then it is almost impossible to track packages in so many remote databases (100 stores
and head office).
LS Retail provides a tool to track the package flow which is called Remote Administration Tool. This is
an interface to view the status of packages on source location as well as the status of packages at remote
locations. For example – If data is replicated from head office to stores or from stores to head office then
the Remote Administration Tool will provide the status of packages at head office and the status of
packages at stores in the head office database (or scheduler database if used). The DD Service at head
office maintains the status of packages in IncomingMessages and OutgoingMessages Table of the Log
database and, in same way, DD services at stores will also maintain the status of packages in the same
way.
The Remote administration tool uses two more tables, Remote Inc. Msg. and Remote Outg. Msg. for
storing the package status of remote packages. Data from the IncomingMessages and
OutgoingMessages tables of the log database for remote locations will be replicated to the Remote Inc.
Msg. and Remote Outg. Msg. tables. Using this tool, the status of current location packages and remote
packages are available in one database because of which administration becomes very easy.
Chapter 6 - Administration 72
Data Director User Guide
Incoming Incoming
Outgoing Outgoing
Rem. Incoming
To use the Remote Administration tool, distribution locations need to be defined for which the packages
need to administered in LS Retail – Scheduler, DD Administration, DD Administration Setup.
Once the setup is done for all the distribution locations then, by using DD Administration Card, the
packages at different locations can be tracked. A codeunit, Update Remote Statuses, can be run in the
Scheduler (DD Administration Card – Checks-Check All Locations) to read information from the
Incoming/Outgoing Messages tables from any Data Director within the whole system.
Chapter 6 - Administration 73
Data Director User Guide
Every time it runs, it goes through all enabled lines in this table, connects to the relevant Data Director
and requests it to report the latest changes in the Incoming/Outgoing Messages tables. The latest
changes are identified from the Counter field in each table, and Last Inc. Counter and Last Outg. Counter
store the latest counters received.
Once the remote messages are in the head office database, the user can:
View the status of messages
Change the status of messages
Send status updates to the remote database such as resetting the Trycount
Reprocess messages that contain configuration errors
Remote Inc. Msg. and Remote Outg. Msg. can also be updated and the Update Remote Statuses
codeunit then updates the relevant Incoming/Outgoing Messages line next time it runs. Note that the tool
will not get rid of configuration errors, only help to deal with them.
To update package status for remote locations using the Remote Administration tool, the setup needs to
be done in the Administration Setup. For the distribution locations for which the status or value in the
trycount field needs to be updated, the Update Location field should be check marked. This feature is
used when Remote Incoming/Outgoing messages from stores have been read. By placing a check mark
in this field, all changes/corrections made locally will be sent out to the remote location. By default, this
field is hidden in the DD Administration Setup so you need to make it visible through the show column list.
This could for example be a cancellation of a package or resetting of the Trycount field. The status can be
updated by drilling down the incoming and outgoing messages in the remote administration tool and will
be updated (replicated) to the location at the same time that the following process is started:
Chapter 6 - Administration 74
Data Director User Guide
6.2 Troubleshooting
Error Codes
Following is a list of error codes, the probable cause of the error and how to resolve it. In some cases a
brief description of the scenario is included.
Chapter 6 - Administration 75
Data Director User Guide
Resolution
Check the DNS registration of the name or the entry in the hosts files (on all computers involved). Make
sure the name in the Distribution Location matches the one in the Data Director Settings Tool.
Error 4103 (0x1004) - Receiver has rejected the package, probably wrong password used
A connection was established but failed during transfer.
Probable Cause
Network failure or package rejected by receiver because of a wrong password.
Resolution
Check if the password is correct or wait for the next retry. (Network may be unstable).
Chapter 6 - Administration 76
Data Director User Guide
Chapter 6 - Administration 77
Data Director User Guide
Error 12297 (0x3009) - The Data Director license file does not include this plugin ID
Probable Cause
The plugin ID in the connection string may be incorrect.
Plugin may not be included in the license being used.
Resolution
Check the Plugin IDs in the DD license (Use the Show Current button on the first page of the Data
Director Settings Tool).
Obtain a DD license that includes the plugin.
Chapter 6 - Administration 78
Data Director User Guide
Summary
This section explains Data Director Administration. Following are the topics included in this section:
Chapter 6 - Administration 79
Data Director User Guide
7 Optimizing Replication
7.1 Preload Actions
Data distribution can be done using Actions in LS Retail. But if a new store/POS is opening, a fresh
database needs to set up for that store/POS. In case all data were to be sent to this database, the best
replication method would be By Normal. But in case only specific data, for example only selected items,
prices and so on, should be replicated into this database, the replication method By Normal does not
work without major workarounds. Creating Preactions by running a Modify on the requested tables could
result in that the data will not only be sent to the new database but to others with existing data as well. In
this case the Preload Actions functionality will help create only Actions for specific tables and specific
distribution locations even without running a Modify.
A specific combination of Scheduler Subjob and Scheduler Job creates the Actions that are used for the
Preload and replicates the data.
Suggested Group
Replic. Method
Store to POS
POS to Store
Linked Table
Store to HO
HO to Store
Table Name
Frequency
Table No.
Item Variant
10001414 If needed If needed No No Actions Special Item
Registration
Variant Framework
10001417 If needed If needed No No Actions Special
Setup
10001430 Collection Framework If needed If needed No No Actions Special Item
10001446 Period Group If needed No No No Actions Special
Product Attribute
10001451 If needed No No No Actions Special
Settings
99001451 Barcodes Yes Yes No No Actions Often Item
99001452 Linked Item Yes Yes No No Actions Often
99001453 Periodic Discount Yes Yes No No Actions Often
Periodic Discount
99001454 Yes Yes No No Actions Often
Lines
99001459 Barcode Mask Yes No No No Actions Special
99001461 Staff Yes Yes No No Actions Special Setup
99001462 Tender Type Yes Yes No No Actions Special
Tender Type Card
99001464 Yes Yes No No Actions Special
Setup
Trans. Tender Declar.
99001465 No No Yes Yes Normal Special
Entry
Actions
99001466 Tender Type Setup Yes No No No Special
99001469 Initial Entry No. in Loc. If needed If needed No No Normal Setup
99001470 Store Yes Yes No No Actions Special
99001471 POS Terminal Yes Yes No No Actions Special
Normal
99001472 Transaction Header No No Yes Yes Often Trans
Source
99001473 Trans. Sales Entry No No Yes Yes Normal Often 99001472 Trans
99001474 Trans. Payment Entry No No Yes Yes Normal Often 99001472 Trans
Trans.
99001475 No No Yes Yes Normal Often 99001472 Trans
Income/Expense Entry
Income/Expense
99001476 Yes Yes No No Actions Special
Account
99001477 Trans. Coupon Entry No No Yes Yes Normal Often 99001472 Trans
99001478 Trans. Infocode Entry No No Yes Yes Normal Often 99001472 Trans
Table Specific
99001479 Yes Yes No No Actions Special 99001482
Infocode
Barcode Mask
99001480 Yes No No No Normal Setup
Segment
Discount Validation
99001481 Yes Yes No No Actions Special
Period
99001482 Infocode Yes Yes No No Actions Special
99001483 Information Subcode Yes Yes No No Actions Special 99001482
Normal
99001485 Posted Statement No No If needed No Often
Source
99001486 Scheduler Setup Yes If needed No No Normal Setup
99001487 Statement No No If needed No Normal Often Statement
99001488 Statement Line No No If needed No Normal Often 99001487 Statement
Posted Statement
99001489 No No If needed No Normal Often 99001485
Line
99001490 Trans Inventory Entry No No Yes Yes Normal Often 99001472 Trans
Tender Type Card No.
99001491 If needed If needed No No Actions Special POS
Series
POS Terminal Receipt
99001492 Yes Yes No No Actions Special Item Setup
Text
99001493 Transaction Status No No Yes No Normal Often 99001472 Trans
Trans. Sales Entry
99001494 No No Yes No Normal Often 99001472 Trans
Status
Trans. Mix Match
99001496 No No Yes Yes Normal Often 99001472 Trans
Entry
99001497 Distribution List If needed No No No Actions Often Item Setup
POS Button
99008937 Yes Yes No No Actions Special POS
Parameters
99009200 Statistic View Yes No No No Normal Setup
99009201 Statistic View Lines Yes No No No Normal Setup
To run replication successfully, the replication information should fill in that will be used in all distribution
locations in the system.
1. Click LS Retail - Scheduler, Setup, Scheduler Setup. The Scheduler Setup window appears.
2. On the General tab, fill in the Days Actions Exist and Days Sched. Log Exists fields.
The Days Sched. Log Exists field contains the number of days the Scheduler Log should exist in the
program. The codeunit Delete Logs (99001486) uses this field to restrict the number of scheduler log
entries that are deleted each time the codeunit is run. If 1 is entered in this field, the codeunit running
today deletes all scheduler log entries created before yesterday, that is, scheduler log entries exist for
yesterday and today.
In central configuration, Data Director is installed in one central location accessible to head office and all
store databases. The DD Services will be created in this machine which will cater to head office as well as
to all the stores.
HO DD HO
......... DD
DD ST1 DD ST2 DD ST3 ..... STn
. . . . . . . . . . . StoreN
...
Store1 Store2 Store3
In this configuration all the distribution locations will be defined in the database from where the job will be
initiated and the database should have the distribution location card defined for source and destination
database and at the distribution location for source (for example head office) should contain the DD
Service which is catering to source database (DD HO) and similarly for stores also.
In Split configuration, Data Director is installed at head office as well as at stores. The DD service catering
to stores will be created at stores and services catering to head office will be created at head office. In
this configuration, data should be pushed from source to destination.
HO
DDHO
.............
DD ST1 DD ST2 DD ST3 DD STN
.
Store1 Store2 Store3 StoreN
To push data from source to destination, the distribution location for source as well as for destination
database should be defined in source database. The distribution location for store should contain DD
service running at store and distribution location for head office should contain DD Service running at
head office. Distribution locations should be defined absolutely in the same way whether it is head office
database or store database.
When Fixed IP is available only at one central location, data needs to be pushed or pulled from stores.
Store service will be used to read data from the store database and send data to head office service
which will write data into the head office database. Store services will be used to pull data from head
office; that is, store service will read data from the head office and write data into the store database. This
configuration is little different from Split configuration; that is, the store server has the address of the head
office server or DD services running at head office but the head office services cannot communicate with
store services or the store server because the head office server cannot recognize the store server as it
has no Fixed IP address.
In this configuration, Distribution Location Cards should be defined in store databases and to pull data
from store to head office, the distribution location should be defined for store as well as for head office
with DD Service running at store that may be same service for both store and head office or it may be
different. To send data from store to head office, one more distribution location card should be defined for
head office which should contain the DD Service running at head office.
In this case, different services can be created to forward data packages to a set of stores. For example if
there are 100 stores there can be 10 forwarder services which will be used to forward data packages. 1
nd
forwarder services will forward data package to 10 stores, The 2 service will forward to next 10 stores
and so on. This will speed up the process and there can be different services to read and write the data at
head office.
In this configuration, distribution location cards should be defined in the head office database (Scheduler
database if different from head office database).The Distribution location card for head office should have
DD Service running at head office (If there are different services for reading the data and writing the data
then in head office database, distribution location for sending data from head office to store should
contain the reading DD service) and the distribution location cards for store1 to store 10 should contain
distribution server as DD Service running at store (which will receive the package being forwarded by DD
nd
Service at head office) and in forwarder, DD Service running at head office in forwarder mode (2 stage
Data Director for which data package owner is the DD service running at head office that created the
package – reading DD service).
The same method is used to send data from store to head office, distribution location card for head office
should be defined in the store database with DD Service running at head office (If there are different
services for reading the data and writing the data then in head office database, distribution location for
sending data from head office to store should contain the writing DD service) and distribution location
card for store should be defined in store database with DD Service running at store.
Summary
This section explains about Optimizing the Replication, Tables to replicate, Fields and Tables to exclude
from replication. Following are the topics covered in this section:
Preload Actions
Tables to Replicate
Fields and Tables to exclude from replication
Specifying general replication information
LS Configuration Use Cases.
8 Exercise
1. Create a Distribution Location Card for source location with following information:
2. Check the test connection from Functions, Test Connection with Data Dir.
3. Setup the Distribution Location Card for destination locations in the same way as we did in steps 2 and 3.
4. Create Scheduler Sub Job with the following information:
ID : ITEM
From-Table ID: 27 (Item Table)
To-Table ID: 27
Replication Method: By Actions
Field Transfer Type: All
Action Table ID: 99001509 (Actions)
Type Code: DD
Distribution Restrictions: Include List
Object Type: Codeunit
Object No.: 99001466 (Data Distribution)
All required setup for Item Master replication is now complete. The Job ITEM can be replicated by clicking
on Scheduler Job, Run Now or can be replicated by LS Scheduler automatically.
Chapter 8 - Exercise 89