Retrieve records using a GetConnector (Command Line Utility)

Command line for running a GetConnector. A GetConnector enables you to store records from Profit in an external file.

This method is not supported in AFAS Online.

General comment

Action:

GETCONNECTOR

General options:

Default.

  • The user performing this action must be authorised for it.
  • /O and /L are mandatory.

Example:

"C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE" /O"ADM" /G"EXT" /W"qwerty" /L"C:\Woonplaatsen.log" GETCONNECTOR /N"Cities" /F"C:\Woonplaatsen.xml" /O"1" /I”Nederland.xml” /M /S"2" /Y

User 'EXT' with password 'qwerty' is logged on to the 'ADM' environment.

The 'Cities' GetConnector is called and the result with field names is saved as XML to the file 'C:\Woonplaatsen.xml'; the file is overwritten if it already exists.

The XML schema used is the Microsoft DataSet.

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