Перейти к основному содержимому

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 DocumentsSuggest Documents Runs
Runs in your own session, which is blocked until it finishesRuns in background sessions; your session stays free
Employees are processed one after anotherEmployees are split between several sessions working at the same time
You see a progress window and a summary at the endYou see progress on the page, and the run is kept with everything it did
If it fails part way, you run it againYou continue the run from where it stopped
Suitable for a single employee or a small groupSuitable 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.

FieldDescription
Run No.The number of the run, assigned automatically.
StatusWhere 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 CodeThe calculation period the run creates payroll documents for.
Calculation Group CodeThe calculation group of the run. Empty means the final payroll calculation by the groups of the employees themselves.
Calculation DateThe date the documents of the run are calculated on.
To ProcessHow many employees the run planned to process.
ProcessedHow many employees the background sessions have reported as done.
Failed ChunksHow many parts of the run ended in a failure. Highlighted in red when it is not zero.
Started At / Finished AtWhen the run started its background sessions, and when it reached its final status.
Created ByThe user who created the run.
ButtonDescription
New RunCreates 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.

FieldDescription
Calculation Period CodeThe calculation period the payroll documents are created for. Filling it in also sets the calculation date and the payment period.
Payment Period CodeThe payment period the documents are created for. Available in the Polish and Moldovan localizations.
Calculation DateThe 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 DateOnly 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 CodeThe 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 DocumentsA 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 PayeesThe 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.

FieldDescription
Worker CountHow 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 SizeHow 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.

Step 3. Choosing the employees the run works on​

ButtonDescription
Set FiltersOpens the filters on the employees and on the positions — the same filters the classic function offers on its request page.

The filters are stored on the run, so it is always visible which population a run was made for, and the same population can be selected again later. The filters in force are shown in the Filters FactBox on the right side of the card.

If you set no filters, the run covers all employees that the parameters apply to.

Step 4. Select Employees​

ButtonDescription
Select EmployeesWorks out which employees the run will process, checks the environment, and shows everything it found. Nothing is created and nothing is calculated at this point.

This step answers the question "what is this run going to do" before anything is written. After it, three things are filled in.

1. The numbers of the Selection FastTab

FieldDescription
Total EmployeesHow many employees the selection considered (not counting employees outside the position filter and terminated employees without payroll entries in the period — see below).
To ProcessHow many of them the run will actually process.
ExcludedHow many were excluded, with the reason for each of them in the list below.

2. The Selected Employees list

The employees the selection considered are listed, whether they will be processed or not.

FieldDescription
Employee No. / Employee NameThe employee.
Calculation Group CodeThe calculation group the employee will be calculated by.
IncludeWhether the employee is part of the run.
Skip MessageWhy the employee was excluded.

The most common reasons for an employee to be excluded are: the employee is already calculated for the period; the previous period is not posted; the timesheet of the period does not have the required status; the employee is blocked.

Employees whose actual position does not match the position filter, and terminated employees without payroll entries in the period, are not listed at all and are not counted in Total Employees or Excluded: they are not candidates for the run, so they are not exclusions either.

3. The messages about the environment

Findings are shown on the standard Error Messages page. Besides the exclusions, this step warns about the things that affect a mass run in particular:

  • Documents that already exist. If some of the selected employees already have a payroll document for the period, you are told how many. With a named calculation group, this means that the run is going to create a second document for each of them.
  • The number series of payroll documents. A number series that assigns numbers one at a time makes the background sessions wait for each other and cancels out most of the benefit of running in parallel. If the number series is not set up to assign numbers without gaps, the run is not allowed to start until it is corrected.
  • The calculation date. If it falls in a different month than the end of the calculation period, you are asked to confirm before the selection is built.

A run can only be calculated after this step. If something blocking was found, the run stays in Draft and Calculate remains unavailable.

Step 5. Calculate​

ButtonDescription
CalculateSplits the selected employees between the background sessions and starts them. You are asked to confirm, with the number of employees and the number of sessions in the question.

From here on the payroll documents are created in the background. You can leave the page, work with other pages, and come back to the run later — the run does not depend on your session. If you closed the card and opened it again, choose Refresh so that the card starts following the run again.

Each session commits every employee's calculation group as soon as it finishes it. This is why a run that stops part way still keeps everything it has already created, and why it can be continued rather than repeated.

Step 6. Following the run​

The status and progress fields of the card update themselves while the run is working and stop updating once it is finished. The Chunks list does not update itself — choose Refresh to see where every chunk is.

FieldDescription
StatusWhere the run stands.
Started At / Finished AtWhen the run started, and when it reached its final status.
ProgressA bar that shows how much of the run has been reported as processed.
Not ProcessedHow many of the selected employees have not been reported as processed yet.

An employee is counted as processed as soon as its first calculation group is committed, so the progress moves while the last documents of that employee are still being finished.

The Chunks list below shows the individual parts of the work, one line per part, so you can see what every session is doing. The list shows the state at the moment the card was opened or Refresh was last chosen.

FieldDescription
Chunk No.The number of the part.
StatusWhere the part stands. See the table of chunk statuses below.
Member CountHow many employees the part holds.
Processed / Not ProcessedHow many of them are done, and how many are not.
Session IDThe background session that took the part.
Started At / Finished AtWhen the part was taken, and when it ended.
Retry CountHow many times the part has been put back into the queue.
Last Employee No.The last employee this part finished. A restart continues from here.
Failed Employee No.The employee the part stopped on, when it failed.
Error MessageWhat went wrong.
ButtonDescription
EmployeesOpens the employee list filtered down to the employees of the selected part.

Step 7. Stopping a run and continuing after a failure​

ButtonDescription
StopStops the run. Every session finishes the employee it is working on and stops there. Stopping is not undoing: the payroll documents already created are kept.
Restart Failed ChunksPuts the parts that failed, were cancelled, or never started back into the queue and starts the sessions again. The parts that completed are not repeated.
RefreshReads the state of the run and the Chunks list again — the list does not update by itself — and switches the automatic update of the card back on. It also closes a run whose background sessions have all gone away without reporting, which turns a run that still says Running into its real result.

Restart Failed Chunks continues each failed part from the employee it stopped on, so the employees that were already calculated are not calculated twice. With an empty calculation group, the employee the part stopped on is picked up once more — the calculation groups already calculated for that employee are skipped, and only what is still owed is created.

A restart is not possible while a session is still working on a part: wait for it to finish, or use Refresh once its session is gone.

If a background session is lost — the service is restarted, the session is ended — its part is picked up by another session after the time set in Heartbeat (Min.). If no session is left at all, the part is marked as failed and Restart Failed Chunks is the way forward.

Run statuses​

StatusMeaning
DraftThe run is being prepared. Parameters and filters can be changed.
PreflightedThe employees have been selected and nothing blocking was found. The run can be calculated.
RunningThe background sessions are creating the payroll documents.
CancellingStopping has been requested; the sessions are finishing their current employees.
CompletedEvery part of the run completed successfully.
Completed with ErrorsThe run finished, but at least one part failed. Look at the chunks to see what happened, and use Restart Failed Chunks.
CancelledThe run was stopped. What was created before that is kept.
FailedThe run could not be completed. This also covers a run that could not start a single background session — a restart is the way out of it.

Chunk statuses​

StatusMeaning
PendingThe part is waiting in the queue for a free session.
RunningA session is working on the part.
CompletedEvery employee of the part is done.
FailedThe part stopped on an error, or its session was lost. The error and the employee are on the line.
CancelledThe part was stopped together with the run.

Deleting a run​

A run is deleted from the list of runs like any other record, together with its parts. A run that is still being worked on cannot be deleted: stop it first, or wait for it to finish. Deleting a run does not delete the payroll documents it created — those are deleted from the payroll documents list in the usual way.

Runs are kept until you delete them, so the list stays a history of the payroll calculations of the company.

Good to know​

  • Prepare the number series once. A number series for payroll documents that assigns numbers without gaps is the single setting that matters most for the speed of a parallel run. Select Employees tells you when it is not set up that way.
  • Employees that are already calculated are excluded, exactly as with the classic function, so re-running a run over the same period does not duplicate work. With a named calculation group, however, a second document is created for an employee who already has one — the selection warns about it before the run starts.
  • Deleting and recalculating payroll documents is not part of a run: documents are deleted from the payroll documents list as usual, and afterwards a new run creates them again.
  • The run does not navigate to the documents it created. To see them, open the payroll documents list and filter by the calculation period.
  • The employees the run considers are checked again while it works, so an employee whose data changed between selecting and calculating is treated correctly. This is also why the number in To Process is an estimate of the work and not a promise.
  • A run cannot be scheduled; it is started by a user from its card.
© 2008 - 2026 SMART business