Schedule a task
Create a scheduled task to run maintenance, an audit or a backup on the company file at a time you choose, daily, weekly or monthly. SQL Server Agent on the server runs it, so the program does not need to be open. The example on this page is a weekly task on Friday at 11 PM with two steps, Audit Materials Balances and Prices and then Audit Accounts Balances.
Before you begin
- Open the company file. The scheduling tool shows for a key that includes accounting and the standard reports. In the subscription edition it needs the highest plan.
- You need these permissions: Schedule in Users Management > Reports, Scheduled tasks - Add new task in Operations, and the permission of the operation itself for each step type you want to add (Current Tasks).
- Make sure SQL Server Agent is running on the server machine, or the task will not run. If it is stopped, the program shows a note about it at the top of the Current Tasks window.
- The task does not lock the file, and users may work while it runs. Choose a time when nobody is working. If the server is off at the scheduled time, the program does not run the task later (When the program or the computer is off).
- Maintenance steps work on all the data of the file. Take a backup first (Take a backup first). To add an automatic backup before the maintenance see Schedule an automatic backup.
Steps
Open the window
- Click File, then Tools, then Schedule. The Current Tasks window opens.
- Click New. The Scheduled Task dialog opens.
Name the task and add the steps
- In Task Name type a name that is not used in the file, such as
Weekend maintenance. - Click New in the task dialog. A wizard titled Scheduled Tasks opens.
- In the Task list choose Audit Materials Balances and Prices, then click Next.
- Leave the options as they show, or set them (Scheduled task steps). Then click Finish. The step shows in the Scheduled Maintenances list.
- Click New again and choose Audit Accounts Balances. This type has no options page, and the Finish button shows at once. Click it. The second step shows under the first.
- To change the order, select a step and click the up or down arrow. The steps run from top to bottom.
- Check Stop the process when it fails on the step where the whole task must stop if it fails. If you leave it unchecked, the task goes on to the next step. The check box is disabled on the last step. If a step without it fails and the last step succeeds, the task shows Succeeded. When you open a saved task, its last step shows the box selected; clear it if you add a step after it and the task should go on after that step fails.
Set the schedule
- Click Schedule.... The Schedule Tasks dialog opens.
- Choose Weekly in Schedule Type, then Fri in On. If you are modifying a saved Weekly or Monthly task and want Daily, delete it and create it again: the program keeps the earlier day value, so the task runs every few days, not every day (Schedule Tasks dialog).
- Leave Once selected. Choose Every only if the task must repeat on the same day at an interval of hours.
- In Timing type H
11, M0, S0, and choose PM. - Leave From date as today, and in To Date choose the last day the task should run. The default is the Closing Date of the file.
- Click Ok. The schedule description shows in the task dialog, such as "Weekly At 11:0:0 PM From 04-12-2026 On Fri".
Save
- Click Ok in the task dialog. The program checks the name, the schedule and the steps, then registers the task on the server, enabled. It shows in the list with the status Unknown until it runs for the first time.
- To try the task at once, select it, right-click and choose Run. Click Refresh to see In process and then the result. A test really runs the steps on the file, so do it on a test copy if the steps are heavy.
Result
- The task is registered in SQL Server Agent under a name that carries the database name of the file, and it runs at its times every week. SQL Server Agent works out the first run: the first Friday at 11 PM after the moment of saving, on or after the start date. Saving does not run the task.
- The program records the addition in the Log File under the type Scheduled Tasks.
- Check the results after the first run in Review scheduled task results.
If something goes wrong
| Message | Why it appears | What to do |
|---|---|---|
| The task without name | Task Name is empty. | Type the name. |
| The task with no schedule | You did not click Schedule... or did not confirm it. | Click Schedule... and confirm with Ok. |
| The task with no maintenance | The list has no steps. | Add a step. |
| Name exists! Please enter different name | A task with the same name exists in the file. | Change the name. |
| Select hour between 1 and 12, or the minutes, the seconds or the day | A value is outside its range in the schedule dialog. | Correct it. |
| Start date is more than End date | From date is after To Date. | Correct both dates. |
| To execute tasks, you need to run SQL Server Agent | The service is stopped on the server. | Start it. Tasks do not run while it is stopped. |
The full list of messages is in Current Tasks.
Related
This page applies to alameen ERP 10, version 10.1.79.764.