Import data (Remote Command Line Utility for AFAS Online)
Use the IMPORT command line action to import records from an import file, based on an import definition.
Note:
The maximum size of the data involved in the full command run from the command line is 50 MB.
Contents |
Import records with attachments
You import records from an import file. The import definition must exist in the environment in which you want to import the records..
If you are also importing attachments or images, the following applies:
- Place all images in a separate folder on the system on which you run the command line.
Note:
The maximum size of the data involved in the full command run from the command line is 50 MB. When you run the command line, all files in this folder will be included in the command, even the files that are not imported.
- In the batch file, include a reference to the folder with the images.
- In the import file, only include the name of the images to be imported (without the path).
- In the import definition, specify that the field from the batch file must be used for the image and attachment fields (see below).
Example:
You want to import new articles, including photos of the articles.
You place all photos in the following folder: C:\itemphoto.
In the command line, you include a reference to this folder.
In the import file, you only include the file names of the photos: Camcorder1000.jpg, Camcorder1010.jpg, Camcorder1020.jpg, etc.
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: |
IMPORT |
Syntax: |
afasremotecmd.exe /O"Environment" /F“attachment file location" /L“General log file" IMPORT /N“Import definition" /F“import file" /L"Import log file" When importing data into a financial administration, you have to include the administration number. The command line can contain an administration number specified using the /A option, but the import definition can also contain an administration number. In that case, the administration number of the import definition is used. The import user must have access to the administration in question and must have opened the administration at least once. |
Example: |
afasremotecmd.exe /D"AOL" /G"12345.CONNECTOR" /W"586^&WWq" /O"O12345AA" /F"C:\itemphoto" /L"logfile.log" IMPORT /N"items" /F"item.txt" /L"items.log" The command line is run using the following data:
|
Extra options
Option |
Explanation |
---|---|
/F |
File location of attachments, such as images. If you are not importing any images, do not include this option. |
/F |
Import file |
/X |
Delete the import file after importing. In an import definition, you can specify that the import file must be deleted after the records have been imported. If you are using AFAS Remote, this setting is ignored. If you want to delete the import file, include the /X option on the command line. |
/Y |
Delete the log file before starting the import. In an import definition, you can specify that the log file must be deleted before the records are imported. If you are using AFAS Remote, this setting is ignored. If you want to delete the log file, include the /Y option on the command line. |
/L |
Maintain log files and write them to the system on which you are running AFAS Remote. Two log files can be generated: a general log file and a specific log file. Import lines with errors are logged in the specific log file. If you want to log error information as well, specify this in the import definition. Otherwise, you only see the lines that have resulted in an error. |
To set up an import definition:
- Open the Profit environment in which you want to perform the import action.
- Go to: the import function.
- Add an import definition.
- Link the fields from the import file to the Profit fields.
- Select Bestandsnaam aanpassen voor AFAS Online for every field to import a file.
- Finish setting up the import definition.
Import records without attachments
You import records from an import file.
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.
AFAS Online |
|
---|---|
Action: |
IMPORT |
Syntax: |
afasremotecmd.exe /O"Environment"/L“General log file" IMPORT /N“Import definition" /F“import file" /L"Import log file" |
Example: |
afasremotecmd.exe /D"AOL" /G"12345.CONNECTOR" /W"586^&WWq" /O"O12345AA"/F"C:\itemphoto"/L"logfile.log" IMPORT /N"items" /F"item.txt" /L"items.log" |
Also see
Directly to
|