Parallel Payroll Document Generation
The usual Suggest Documents function creates payroll documents one employee after another in the session you started it from: while it works, that session is busy, and for a company with hundreds or thousands of employees the whole payroll calculation can take a long time.
Suggest Documents Runs does the same job, but splits the employees between several background sessions that work at the same time. Because the work happens in the background, you can keep working in Business Central while the payroll is being calculated, watch the progress on screen, see what failed and why, and continue a run that stopped part way instead of starting everything again.
The result is the same as with the classic function: the same parameters, the same employee filters, the same payroll documents. What changes is how long it takes and how much you can see while it happens.
| Suggest Documents | Suggest Documents Runs |
|---|---|
| Runs in your own session, which is blocked until it finishes | Runs in background sessions; your session stays free |
| Employees are processed one after another | Employees are split between several sessions working at the same time |
| You see a progress window and a summary at the end | You see progress on the page, and the run is kept with everything it did |
| If it fails part way, you run it again | You continue the run from where it stopped |
| Suitable for a single employee or a small group | Suitable for a mass calculation of the whole company |
Both functions remain available and can be used side by side.
Step 1. Opening the list of runs
Path: Payroll Documents → Suggest Documents Runs, or Posted Payroll Documents → Suggest Documents Runs. The page can also be found through the search as Suggest Payroll Documents Runs.
Every launch is kept as a separate line, newest first, so the list is at the same time the history of payroll calculation for the company.
| Field | Description |
|---|---|
| Run No. | The number of the run, assigned automatically. |
| Status | Where the run stands. See the table of statuses below. The status is highlighted with a color: green for a run that completed, red for a run that failed. |
| Calculation Period Code | The calculation period the run creates payroll documents for. |
| Calculation Group Code | The calculation group of the run. Empty means the final payroll calculation by the groups of the employees themselves. |
| Calculation Date | The date the documents of the run are calculated on. |
| To Process | How many employees the run planned to process. |
| Processed | How many employees the background sessions have reported as done. |
| Failed Chunks | How many parts of the run ended in a failure. Highlighted in red when it is not zero. |
| Started At / Finished At | When the run started its background sessions, and when it reached its final status. |
| Created By | The user who created the run. |
| Button | Description |
|---|---|
| New Run | Creates a new run and opens its card. Nothing is calculated yet. |
Step 2. Creating a run and choosing the parameters
Choose New Run. The card opens with the calculation period of the current work date already filled in, together with the calculation date and the payment period that follow from it, so in most cases you only need to check the values rather than enter them.
The Parameters FastTab holds exactly the parameters of the classic Suggest Documents function, and they behave in the same way: choosing a calculation period fills the calculation date with the last day of that period, To Date is only accepted for a calculation group that calculates part of a period, and so on.
| Field | Description |
|---|---|
| Calculation Period Code | The calculation period the payroll documents are created for. Filling it in also sets the calculation date and the payment period. |
| Payment Period Code | The payment period the documents are created for. Available in the Polish and Moldovan localizations. |
| Calculation Date | The date the documents are calculated on; it becomes the posting date of the created payroll documents. By default it is the last day of the calculation period. |
| To Date | Only for a calculation group that calculates part of a period (interim). The calculation includes only the entries that start on or before this date. Leave it empty to calculate the whole period. |
| Calculation Group Code | The calculation group the run calculates by. Leave it empty for the final payroll calculation — then the calculation group of the employee card is used, and, when payroll status details are enabled, a document is created for every calculation group that is not calculated yet. |
| Create New Documents | A new payroll document is always created. When turned off, an existing document for the same period and calculation group is reused: its lines are deleted and the calculation is done again in it, and employees whose documents are already calculated are then no longer excluded from the run. |
| Calculate For Payees | The run processes the employees flagged as being without a labor contract. |
The Parallelism FastTab decides how the work is divided. The default values suit most runs and normally do not need to be changed.
| Field | Description |
|---|---|
| Worker Count | How many background sessions process the run at the same time. Default: 5. More sessions do not always mean a faster run — the database is shared between them. |
| Chunk Size | How many employees one session takes at a time. Default: 100. A part is only closed where it can keep all the employees of one person together, so a part may turn out slightly larger than this number. |
| Heartbeat (Min.) | How long a session may stay silent before another session is allowed to take its part over. Default: 5 minutes. This is what allows a run to finish when a session has been lost. |
All employees of the same person are always processed by the same session — the run never splits them. This is what makes the parallel result identical to the result of the classic function.
Changing any parameter, or any filter, after the employees have been selected returns the run to the Draft status and clears the numbers of the Selection FastTab: they describe a population that no longer matches the parameters. Select the employees again before you calculate.