Add a task to the Command Scheduler

Article • 6/8/2026 • 3 min read

You can schedule tasks that must be periodically performed to run in the background. Some standard tasks are already available and you can copy these tasks.

You can also add a new task that is not part of the standard M2M background tasks. Before you add such a task in the Command Scheduler, you must customize the CommandSchedulerBusinessComponent. Add a public method in the CommandSchedulerBusinessComponent in the following format:

Public Overridable Sub \<\<Method Name\>\> (ByVal entityName As String, ByVal attributeName As String, ByRef row As System.Data.DataRow, ByRef dataObject As System.Data.DataSet)

For example, if you want to create a command that automatically closes all Sales Orders that have been On Hold for more than six months, you can extend the CommandSchedulerBusinessComponent and add a public method in the below format:

Public Overridable Sub OnHoldSOClose(ByVal entityName As String, ByVal attributeName As String, ByRef row As System.Data.DataRow, ByRef dataObject As System.Data.DataSet)

For more information regarding extending business components, refer to the Form Customization Reference Manual.

To add a task

  1. Open the Command Scheduler (CMDS) page.

    1. Select Utilities > Maintenance > Command Scheduler.

    Or

    1. Search for CMDS or Command Scheduler in the Navigation box and then select Command Scheduler.

    Command Scheduler (CMDS) page appears.

  2. On the Toolbar, click,

    • New: To create your own task that you want to run in the background without manual intervention.

    • Copy: To copy an existing task and modify the settings.

  3. In the Description field, type a description of the task.

  4. Specify the task:

    1. In the Command field, type the command and any needed parameters to trigger the task.

      If you have extended the CommandSchedulerBusinessComponent, then specify the name of the new method in the Command field. For the example given, you will type OnHoldSOClose.

      For internal tasks, type the window mnemonic and any parameters to send the window. Separate parameters with commas.

    2. To set the command as the default command, select the Default Command check box.

      Lock users out of Made2Manage when there is a possibility of the data entered by the users interfering with the task, such as during backups and restores. When the task runs, Made2Manage gives users ten minutes to exit. After ten minutes, Made2Manage logs users out even if they have not saved their work.

  5. Specify execution parameters:

    1. In the Priority field, set the task’s priority.

      1 is the highest priority.

      When you schedule a task to run at the same time as another task, the Command Processor runs them in order of priority.

    2. From the Interval list, select how often you want the command to run.

      To turn off a task, set this to Never. To run it exactly once, set this to On Date.

    3. In the Next Execution Date field, specify the date and time that the command must run next.

      Made2Manage runs the command at each interval at the time you specify. If you chose Daily and set a time of 11 p.m., Made2Manage runs it each night at 11.

  6. To run the command only for a specific company database:

    1. Clear the selected Execute for All Companies check box.

    2. Click the lookup reference button at the end of the Company field.

      The Lookup For Company window is displayed.

    3. Highlight a row and click Select. Or, double-click a row to select the company for which you want to run the command.

  7. To ensure that only a specific user can execute the command:

    1. Clear the selected Execute By Any User check box.

    2. Click the lookup reference button at the end of the User field.

    The Lookup For User window displayed.

    1. Highlight a row and click Select. Or, double-click a row to select the user who can run the command.

    To allow any user to run the command, select the Execute By Any User check box.

  8. On the Toolbar, click Save to save the task.

  9. A unique key is automatically generated by Made2Manage for this entry.