Define parameters for syncing

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.

Using parameters as values in supported types

Example of use: Connection string 

Example of use: SQL

Parameter substitution in scheduled Syncs

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

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.

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

-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"