iProdSync: Additional fields

Adding custom fields, constants or variables and special fields.

This function allows you to define additional fields that may not be present in iProd but your SQL table requires them. From here it is possible to indicate constants or true / false values, or to repeat a previously assigned iProd field.

Example:

- SQL requires a Status = 1 field which is not on iProd
here we set '1' in the iProd field and int type Status in the SQL field

-SQL requires the CODE field equal to the NAME field, already assigned to the iProd 'name' field

here we set the name in the iProd field and CODE in the sql field of type string.

During synchronization the CODE field and the NAME field have the same iProd name value.

The Apply option allows you to decide when the definition is applied

All time

Only in insertion

Only being updated

Only if destination is null

It is possible to specify the same type of field several times for different contexts. For example, if SQL requires the valorisation of the CODE field we can decide to always do it when the record is being inserted and, in updating only if null is found on SQL.

Therefore:

1st definition: From iProd to SQL, iProd name field, SQL CODE field, apply Only in insertion

2nd definition: From iProd to SQL, iProd name field, SQL CODE field, apply only if destination is null.

These mean that, when a new record is inserted in SQL, the CODE field will always take the value of name, while when it is updated, the CODE field will take the value of name only if it does not already contain a value.

The first list on the top left contains three possible selection types: iProd, SQL or special fields

The special fields are fixed values ​​that we intend to valorize during the Sync.

Current Date (@curdate): Insert the current UTC date

For example, if we have a SQL InsDate field that must contain the insertion date we will set:

Usage: From iProd to SQL
IProd field: Current Date (which is placed on the input field with the special name @curdate)

SQL field: InsDate
Apply: Only in insertion

True (@true): Sets the Boolean value to true, according to the target type.

                MySQL
requires the value 1
                SQL Server
requires the value true

False (@false): Sets the Boolean value to true, according to the target type.

                MySQL requires the value 0
                SQL Server requires the value false

NULL (@null): Set this value if you want the target field to be valued with null

Progressive number: sets the field with a number that increases by 1 for each record written.

By selecting this special field, the following value is placed in the destination field:

@ id-replace this text with the number to start from (e.g. @ id-150)

If there is no particular need, set the start from zero @ id-0.

ATTENTION: This value is active for the selected SQL table for the entire duration of the program session.

If you close the application and restart, the count restarts from the one specified in the field (in this example from 150)