Versions Compared

Key

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

Table of Contents
maxLevel3

Info
iconfalse
titleRelated articles
Specifying parameters that can be used in SQL queries, connection strings and file paths allows you to use a single Sync file for multiple 'organisations' in Phocas. These

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

, with the result that the

and as a result, the information structure is sent

any organisation that you have set up to use the . 

The following data item types reference parameters:

  • SQL
  • File
  • Directory.

Defining parameters

  • Select the Parameters tab in Sync.
  • Select Add button to create a new parameter

    to other organizations. 

    1. In Sync, select the Parameters tab.

    2. Click Add.

    3. Enter the parameter name

    and a value into the table, noting that:
    1. . Parameter names are alphanumeric only. Special characters

    can not
    1. cannot be used.

    2. Enter a value. Values can not contain parameters.

    1. Double quotes

    can not
    1. cannot be used

    in values
    1. .

     Image Removed
    1. Image Added

    Using parameters as values in supported types

    Example of use: Connection

    string 

    Image Removed

     

    string 

    Image Added

    Example of use: SQL

    Image Removed
    Image Added

    Parameter substitution in scheduled Syncs

    You can substitute different values for defined

    parameter

    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”

    Examples of the

    Example format for

    using parameters

    Path to sync file

    -r "c:\temp\new sync\sqlparameters.sync"

    Server connection switches

    -user "phocas"

    -password "phocas"

    -service "http://localhost"

    -source "ParametersBro"

    Substituted parameters

    -

    substituted parameters:

    -p:server:

    “localhost“

    “DatabaseServer“

    -p:database "

    phocas_testing_sales

    Sales2016"

    -"p:db table" "

    entity_1

    Sales Customers"

    -p:columns "

    cat_3,cat_4,cat_5

    ID, Address"

    Multiple parameters

    You can substitute

    a number of

    several parameters for a range of data items.

    Example
    Image Added

    Image Removed

     

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

    Code Block
    themeMidnight
    -r "c:\temp\new sync\multipleparameters.sync" -user "
    phocas
    John User" -password "
    phocas
    myPassword" -service "http://
    localhost
    company.example.com" -source "
    SyncParamsFile
    Sales" -p:server "
    localhost
    DatabaseServer" -p:database "
    phocas_testing_sales
    Sales2016" "-p:
    My
    db 
    source
    table" "
    entity_1
    Sales Customers" -p:columns "
    cat_3,cat_4,cat_5
    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