Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3

Info
iconfalse
titleRelated articles

Sync Data Type Specification 

Being able to specify parameters that can be used in SQL queries, connection strings and file paths means you can save time by using a single Sync file for multiple organisations.

from JIRA ... Ability to specify parameters that can be used in SQL queries, connection strings and file paths. gives the ability to use a single sync file for multiple organisations. That is call Sync with different parameters and the same structure of information is sent to a different organisation. 

Each integration can have a single sync file used by multiple organisations. When the sync file is updated there will be no need to update parameters in the sync file 

The ability to specify parameters in Sync which can be used in SQL connection strings, queries and folder paths. These parameters and service parameters can be passed to SyncCLI.

eg a 'sales' or 'budget' file

A new Parameters tab has been added to Sync. This is where the user defines parameters that can be referenced by the following data item types:

  • SQL
  • File
  • Directory

Parameters are defined via the Parameters tab:

bits

invalid parameters?

names/values - alphanumeric. special characters?

 

When you are adding a file, directory or SQL data item to Sync, you can specify parameters to use the Sync file for multiple organizations in Phocas. The parameters are passed to Sync and as a result, the information structure is sent to other organizations. 

  1. In Sync, select the Parameters tab.

  2. Click Add.

  3. Enter the parameter name. Parameter names are alphanumeric only. Special characters cannot be used.

  4. Enter a value. Values can not contain parameters. Double quotes cannot be used.

    Image Added

Using parameters as values in supported types

Example of use: Connection string 

Image Added

Example of use: SQL

Image Added

Parameter substitution in scheduled Syncs

You can substitute different values for defined parameters via scheduled Syncs (SyncCLI).

Individual parameters

To substitute a parameter value, the “-p” switch is used, followed by the parameter name and quoted value. The quoted value is only used for the duration of the session, i.e. the original value defined in Sync remains unchanged.

-p:parameterName “newValue”

-p:server ”localhost“

Note if a parameter name contains spaces, it must also be quoted:

“-p:My Server” “localhost”

“-p:Test Database” “Testing”

Example format for substituted parameters:

-p:server: “DatabaseServer“

-p:database "Sales2016"

-"p:db table" "Sales Customers"

-p:columns "ID, Address"

Multiple parameters

You can substitute several parameters for a range of data items.

Image Added

These multiple parameters can be entered in the Arguments field in a scheduled task:

Code Block
-r "c:\temp\new sync\multipleparameters.sync" -user "John User" -password "myPassword" -service "http://company.example.com" -source "Sales" -p:server "DatabaseServer" -p:database "Sales2016" "-p:db table" "Sales Customers" -p:columns "ID, Address" "-p:sales directory" "C:\temp\Sales" -p:filePath "C:\temp\Customers.txt"

Iterations

The Iterations option in the Sync setup is an advanced option that we recommend you use in consultation with a Phocas consultant. It’s useful in the case of multiple customer data sources, particularly multiple ERPs, linked to one Phocas site. Typically, these data sources are identical, except for having unique credentials and one or more different parameter values. As the setup is almost the same for each source, you can add iterations to the Sync process. This iterative approach removes the need for separate configuration files and makes the Sync setup quicker and less complex.

Each time Sync is triggered, all items are processed for each iteration, in order, with the default parameters being overridden by the iteration parameters.

image-20240611-030630.pngImage Added

On this page

Table of Contents
maxLevel3