Scheduling Background Tasks (Developer or Administrator)
-
Create a background task:
- Create a new record on the Background Task Definitions form.
- Specify a task name (for example, RunCustomerOrderReport) and description.
-
Specify an executable:
For a report, specify the name (not caption) of the report or the Report type form (for example, CustomerOrder) in the Executable Name field and the type of executable (RPT) in the Executable Type field.
For a stored procedure, specify the procedure name in the Executable Name field and select SP in the Executable Type field.
For an executable program, specify the program name and path (for example, c:\Infor\myprog) in the Executable Name field and select EXE in the Executable Type field.
For an IDO method, specify the method name, in the format IDO.Method - for example, MyProgID.SLSites.MyTestMethod, in the Executable Name field and select IDOMTH in the Executable Type field.
- Click the buttons on the form to specify any report options or excluded tasks.
- Save the record.
Your new background task can now be called from any form as an event handler.
-
Check to see if the task is running or waiting.
When TaskMan starts a task, it updates the Started field in the Status Information group box. If the Completed field is blank, the task is still running.
Also, you can see which tasks are currently running by opening the Active Background Tasks form.
-
Optionally, view details about the completed task.
After TaskMan has completed the task, even if it fails, you can view details about its execution on the Background Task History form, which displays this information:
- Task description
- Return status
- User who submitted the task
- Messages triggered by the task
-
Optionally, to return error information to TaskMan from an
executable, use any of these methods in the executable file:
- Put a message in the ProcessErrorLog table. These messages appear in the Task Messages tab on the Background Task History form.
- Print the error message in a file called taskman-install-directory\Output\task-name_task-number.txt (for example, C:\Program Files\Infor\AppName\Output\APChecks_435.txt) TaskMan will use this as an error message in the Background Task History form.
- Return an integer error code. TaskMan puts the EXE return code in the BGTaskHistory table, with return code 0 indicating success.