Skip to content

Building a batch record template: sections, steps, hourly columns, lab points

The template of the batch record says what the operator records for a product’s batch: which sections and steps the production has, what is read off every hour, and where the lab takes samples. A template exists per product and plant, is versioned, and is edited without code or JSON.

  • Permission: batch:template. To view, batch:view is enough; the template is then read-only.
  • Batch production is switched on for the plant (Switching on batch records).
  • There can be one draft per plant and product at a time.
  1. On the Templates tab of the Batch records page choose New batch template, give the plant and the product (a new product can be created), and where it should start from: a blank template (you add everything), a built-in example (a neutral starting point, everything can be changed) or a copy of an earlier template (for another product or plant too). Create draft.
  2. Sections. Add section and name it (e.g. “Reactor: reaction”). Sections and steps are reordered by dragging or, with focus, the ↑ / ↓ arrows. Sections may overlap in time; a section’s state is computed from its steps.
  3. Steps. Add step, and choose what the operator records: Operation from–to (actual quantity, start, end), Setting with time (the time only), Value (a measured or entered number) or Comes from the lab (the lab result is loaded, it can be overridden by hand; a sample point and a parameter must be chosen). Under Details: target value, unit, required, the time recording (start and end, one point in time, or no time), the warning on the step and the state after the step (e.g. “running”), which the diary’s equipment-state row takes over.
  4. Hourly columns. Per section add what the operator reads off every hour: name, instrument tag, type (number or text), limit. A hidden column does not show on the new sheet.
  5. Lab. Define what the lab measures (parameters: name, unit, number or text), then the sample points (e.g. “Finished product”). For each point choose its parameters and, per parameter within the point, enter the low and high limit and whether the measurement is expected. See Lab results on the batch record.
  6. Ratio metrics (optional). Add ratio: name it, choose the numerator and denominator steps (for example a dosed material to the charged raw material), enter the unit and, if there is one, the band (low and high value — the ratio’s tolerance). The preview immediately shows the ratio from the prescriptions and says so when that value falls outside the band. A new ratio starts with two steps of the same unit; a non-number typed into a band field is kept and flagged (not saved). In the analysis (Analytics › Batches › Dosing) it appears per batch, computed from the actuals, as a trend; batches outside the band are marked. The ratio is stored with the template version: to change a published version’s ratio, create a new version. Steps themselves have no tolerance field yet.
  7. Numbering and PDF. First batch number of the year sets where the numbering starts in a new year. The Default PDF version and the orientation are the starting point for printing and can be changed per batch.
  8. The live preview shows what the operator will see. Errors appear next to the field, in plain words. Save draft, then Publish (with a confirmation; it saves first).

The template is published, the New batch button on the Batches tab works for that product and plant, and an open batch shows the template’s version.

What you see Why What to do
“This version is already published, so it cannot be written” You edited a published template. New version, then edit the draft.
“This plant and product already has a draft” One draft at a time. Open the existing one, or publish it first.
“A column of the previous published version is missing” You deleted a published column. Put it back and hide it.
“A published column’s type has changed” You changed the type of a published column. Revert it; a new column is needed for the new type.
“Choose a sample point” A “Comes from the lab” step has no point or parameter. Choose the sample point and the parameter.

Last updated: