Scheduling background tasks (developer or administrator)

  1. Create a background task:
    1. Create a new record on the Background Task Definitions form.
    2. Specify a task name (for example, RunDatabaseSchemaReport) and description.
    3. Specify an executable:
      • For a report, specify the name (not caption) of the report or the Report type form (for example, DatabaseSchemaReport) 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.
    4. Click the buttons on the form to specify any report options or excluded tasks.
    5. Save the record.

    Your new background task can now be called from any form as an event handler.

  2. Optionally, to schedule the task to run in the background, use the options on the Background Queue form to do the scheduling .
    You can schedule the task to run only once or on a recurring daily, weekly, or monthly basis.
    Note: For scheduled background tasks to run, you must have the Infor Framework Event Service configured and running.
  3. 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.

  4. 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
  5. 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.