Run a GetConnector (Remote Command Line Utility for AFAS Online)

Command line for running a GetConnector. A GetConnector enables you to store records from Profit in an external file. The GetConnector must exist in the environment listed on the command line.

Note:

The maximum size of the data involved in the full command run from the command line is 50 MB.

To set up and run a command line:

Create a batch file using the following data and run the file. The task is queued and run as soon as possible. After that, the execution of the batch file is closed.

Explanation 

Action:

GETCONNECTOR

Syntax:

afasremotecmd.exe /O"Environment"/L"General log file" GETCONNECTOR /N"GetConnector" /F"Output.xml"/OOutput format/M/SFormatting/I"filter.xml"

Example:

afasremotecmd.exe /D"AOL" /G"12345.CONNECTOR" /W"586^&WWq" /O"O12345AA"/L"logfile.log"GETCONNECTOR /N"Cities" /F"C:\Cities.xml" /O2 /I"CityFilter.xml

The command line is run using the following data:

  • Environment: O12345AA
  • General log file: C:\Commandline\logfile.log
  • GetConnector: Cities
  • File with records to be exported: C:\Cities.xml
  • XML filter: CityFilter.xml

Options

GetConnector name (mandatory)

/N"getconnector name"

Output file name (mandatory)

/F"output file"

The name of the file in which the result of the GetConnector should be saved.

Output mode (mandatory)

/O"outputmode"

Format in which the result of the GetConnector should be saved:

  • 1 = XML
  • 2 = Text with separators

Please also refer to the comments on the 'Outputoptions' field.

Filters

/I"XML-filter"

XML file with a filter to be applied when you run the GetConnector.

See also:

  • Compile a filter

Include metadata

/M

If you use this option, the metadata (field names) are included in the output file.

Output options

/S"option"

Default value: 1

Use this field in combination with the 'Outputmode' field.

Output mode

Output options

xml (1)

  • 2 = Microsoft DataSet
  • 3 = Microsoft DataSet. Empty elements (elements without a value) are also included in the XML.

text (2)

  • 1 = Semicolon (dates and numbers in the format of the regional settings)
  • 2 = Tab (dates and numbers in the format of the regional settings)
  • 3 = Semicolon (dd-mm-yy for dates and full stop as decimal separator for numbers)
  • 4 = Tab (dd-mm-yy for dates and full stop as decimal separator for numbers)

If you want to include empty fields in the output file, use the following values in the call:

/O"1"

/S"3"

Example:

"C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE"/O"ERPDEMO" /G"Connect" /W"" GETCONNECTOR /L"C:\empl.log" /N"ProfitEmployees" /F"C:\empl_2.xml" /O"1" /M /S"2"

Overwrite or supplement the output file

/Y

When you run this command line, an output file is created.

  • If you use this option, the existing output file is overwritten. This option can only be used in combination with the /"2" output mode (output format = text with separators).
  • If you do not specify this option, the output file is not overwritten.

See also