Home Recent Sign up Sign in

If you want to transfer only the records that have been changed since the last transfer, you can make use of the feature, Source Control.

 

The Source Control field is a field - a number in succession - that must be updated whenever a record is inserted and/or updated. The field is created in the table that the changed data is to be transferred from.
If the table that you want to apply Source Control on already contains a field, which is a number in succession and is updated whenever records are either inserted or modified, no additional programming is required. This could be a field of type Timestamp in MS-SQL based systems.

 

If the table does not contain such a field with the above mentioned capabilities, you need to make additional programming in the table.
First you need to create a new field in the table. This field can be of the type Timestamp or BigInteger or Integer. If you use Timestamp as a Source Control field nothing further is required; But if you use an Integer as a Source Control field, you need to add code, that will update the new field whenever changes are made to records.
For example, applying Source Control as an integer in an Microsoft Dynamics NAV table requires code, that will update the new field whenever changes are made to records.

 

How Source Control works:

When you run a Transfer, where the table you transfer data from uses Source Control, RapidiOnline will first refer to the Runtime Information Register (RTI) in order to see if the Transfer has been run with Source Control before (within the Runtime Information Register, RapidiOnline keeps track on the last used Source Control number/timestamp).
If the Transfer has not been run with Source Control before and no changes have been made since Source Control has been enabled, RapidiOnline will not transfer any records before changes have been made (this is only true for Integer/BigInteger fields).
If the Transfer has been run with Source Control before (that means, if changes have been made), it searches for the last used Source Control number/timestamp and uses this as a filter, when reading in the table data is transferred from. All the records that contain a higher/newer Source Control number/timestamp than this filter, will be read and transferred. After a successfull transfer, RapidiOnline returns to the Runtime Information Register and stores the new last used Source Control number/timestamp.

 

Important:

When using Source Control, it is not possible to perform "Delete" in the Transfer. The reason for this is to prevent having all non modified records in the destination Data Source deleted. You can use Actions in order to delete data.

 

Source Control on a table that already contains a Source Control field

In the Transfer, where you have chosen the requested table as source, you choose "Source Control".
In the field "Source Control Field", you can specify the field that should act as a Source Control.

 

Source Control on a table that does not already contain a Source Control field

In the table that should use Source Control, you create a "Source Control" field. Type should be either a Timestamp or a Big Integer/Integer. If you use a BigInteger, additional programming might be required so that each time a record is either modified or inserted it is assigned the next Source Control number.

 

Since the design has been changed by creating a new field, you must re-run read design. You can run Read Design on the Data Source card under Configuration.


In the Transfer, where you have chosen the requested table as source, you choose "Source Control".

In the field "Source Control Field", you can specify the field that should act as a Source Control.

 

HowTo Implement Source Control in MS Dynamics NAV

 

Source Control Field:

Specify the field that should act as a Source Control.

 

Destination Control Field:

If a Source Control is used in the destination Data Source and the value is not automatically updated by a database level trigger or semilar, you can have RapidiOnline update the Source Control field here as well.
You simply choose the field being used as the destination’s Source Control in the field "Destination Control Field".

 

Commit Per:

In situations, where you have to transfer a large amount of data or where slow and unstable connections are in use, the field "Commit Per" can be very useful.
If you enter a number here, RapidiOnline will do a commit (including storing RTI numbers) each time it has transferred this many records, then continue with the next records.
Commit Per should normally be used in combination with the Source Control feature. In this way you ensure progress in the data transfer if an error happens after a number of records have been transferred as the transfer can resume at the last stored RTI source control value.

 

Transferred Field:

The field "Transferred Field" makes you able to write a timestamp (date/time, text or boolean true value) back into the source table on each transferred record.
The field must contain the name of the field in the Source Table that should be updated when a record is read.

 

Store new ID Field:

A facility to store the ID of a newly created record. The ID is stored in a field in the source table (the field indicated in "Store New ID Field").

The link (key fields) need to be setup in a special way: left side must be a unique key field to the source table (normally the primary key), and the right side must be the name of the id field to get from the destination table (from the newly created record).
Disable Dest. Lookup must be checked.
Only Add must be enabled for this transfer - no update or Delete !

 

Source Mirror:

Allows a mirror of a table to be kept in a seperate DataSource near the Source Database.