# Testing schedules

> Build a sample-by-test schedule, send it to the lab, and track it until the results are in.

A **testing schedule** sets out which tests to run on which samples, ready to send
to a laboratory. It then follows the samples through the lab - picked, dispatched,
received, results back and imported - with a record of who did what and when.

## Build a schedule

Choose **New schedule** and fill in the builder:

<Steps>
  <Step title="Reference and lab">
    Give the schedule a **reference** and choose the **laboratory** - its test
    catalogue becomes available to pick from. The reference can **auto-fill** from a
    format you set in Product OS (for example project ID, lab code and date, such as
    `AB1234-ENV-20260929`) - it fills in the lab's **code / initials** once you pick
    the lab, and stays editable. If a lab has no code set in Product OS, that part of
    the reference is left out.
  </Step>
  <Step title="PO reference">
    Add the **PO reference** for the job. On a new schedule it is filled in from the
    project's last schedule, since a PO usually covers the whole job - a note says
    where it came from, and you can change it.
  </Step>
  <Step title="Details">
    Set **Prepared by**, the **issue** and **due** dates, a **status** and any
    remarks. **Prepared by** can be prefilled automatically (for example with your
    initials) - set that up in Product OS. The **due date** can prefill from the
    issue date plus the lab's turnaround, and is marked **preliminary** until the lab
    confirms it - both stay editable.
  </Step>
  <Step title="Tests">
    Picking the lab adds its **default tests** for you - the everyday tests marked
    **Add by default** in Product OS. They are only a starting point: remove any with
    the **x** next to the test name. Add more from the lab's catalogue or type a
    **custom test**. Each test is listed below the picker, so you can see and remove
    them even before any samples are chosen.
  </Step>
  <Step title="Sample-by-test matrix">
    Pick the **samples** - the picker has a quick **search**, per-column **filters**
    (the same operators as the data tables) and click-to-**sort** headers to manage
    long lists. Then **tick** each test you need for a sample. The quantity defaults
    to 1 - adjust it in the box that follows, or add a note.
  </Step>
</Steps>

<Callout type="note" title="Laboratory or Issued to?">
  Usually the same. **Laboratory** is the lab doing the testing. **Issued to** is who
  the schedule is addressed to on the paperwork - leave it blank and it uses the
  lab's name. Fill it in when the schedule should go to a named contact, another
  branch, or a lab the work is passed on to.
</Callout>

### Picking samples

- **Hide scheduled** in the Add samples window hides every sample already on another
  schedule in the project (unless that schedule was cancelled - completed schedules
  still count), with a count of how many it hides. Tick it, then use select all to
  pick everything not yet scheduled. Samples already on the schedule you are editing
  stay listed and ticked.
- A sample that is **out for testing** on another schedule shows an amber tint and a
  warning sign in the picker and the matrix - hover the sign to see which schedule
  it is on and its status. When you add samples and some are already out, a pop-up
  lists them: choose **Add anyway**, or **Leave them out** to add just the others. A
  sample counts as back once its schedule reaches **Results received** or
  **Imported**.
- A sample that has been **disposed of** shows a **Disposed** tag, and adding it to
  a schedule asks you to confirm. See
  [Sample retention and disposal](/manage/lab-workflow/sample-retention).

### Closing without saving

Clicking outside the builder does not close it. If you press **Cancel**, the **X**
or **Esc** with unsaved changes, it asks **Discard changes?** first - choose **Keep
editing** or **Discard**. With nothing changed, it closes straight away.

The **Details** and **Progress** sections can be collapsed to keep a long schedule
manageable.

## Progress

Each schedule has a **Progress** section with a date for each stage of its journey:

| Stage | Notes |
| --- | --- |
| **PO sent** | When the purchase order went to the lab. Hide it in Product OS if you don't send POs. Never moves the status. |
| **Samples picked** | |
| **Collected** | When the samples left for the lab, collected or sent. Locks the schedule - see below. |
| **Received by lab** | |
| **Results received** | Samples count as back from the lab from here. |
| **Imported** | Filled in by hand. |
| **Report issued** | Optional - off until your company turns it on. Starts the [sample retention](/manage/lab-workflow/sample-retention) clock. Never moves the status. |

Under every stage there is a **By** box to pick **who** did it from your team, such
as who picked the samples or handed them over for collection. It is greyed out
until the stage has a date.

Filling in a stage moves the status on to match, if your status list has the
matching status. It only ever moves **forwards**, and clearing a date leaves the
status alone.

Stage names can be **renamed** and **hidden** for your company in
[Product OS](/product-os/laboratories#schedule-settings) - for example calling
**Collected** "Dispatched" if you send samples yourself. The company's name is used everywhere the stage appears:
on the schedule, in History, in the Table Editor, in Insight and on the exports. A
hidden stage still shows on a schedule that already has a date for it.

### Lab receipt

The **Lab receipt** area in Progress holds the lab's **Lab receipt ref** and a
**Receipt issue** choice - **Not confirmed**, **No issues** or **Issue reported** -
with **Issue notes** when an issue was reported. It works whether or not you use the
Received by lab stage, and stays editable after dispatch. You can search the
schedules list by the lab receipt ref or the PO reference.

### Missing samples

If a sample cannot be found, is damaged or there is not enough of it, click the box
icon at the end of its row and choose **Mark missing**. Pick a reason (**Not
found**, **Damaged**, **Not enough material** or **Other**), when it was noticed and
any notes. **Found it** takes the mark off again.

- You do not record a partial pick or collection yourself: while any samples are
  marked missing, the stage dates show **(partial, 2 missing)** and a red note above
  the samples lists which ones and why.
- Missing samples **stay on the paperwork**, marked as missing with the reason, so
  the lab knows what was not sent and the record stays complete.
- Marks can be changed after dispatch, since they record what happened physically.

### Tubes coming back from the lab

Some samples, such as undisturbed tubes, have to be sent back by the lab. When your
company has set which sample types or containers must come back (in
[Product OS](/product-os/laboratories#schedule-settings)), those samples are tagged
**Tube** on the schedule and get a **Back** tick in the samples table.

- Tick each tube as it comes back, or use **Mark all back** in Progress.
- Progress shows **Tubes to come back**, for example "1 of 2 back". Samples marked
  missing are not counted.
- Ticks stay editable after dispatch, and each one is recorded in History.

If your company has not set any codes, none of this shows.

## Handle with care

Flag a sample **Handle with care** with a short note (for example "possible fibres
seen on site") so the lab knows to handle it in a controlled way. It is a
**precaution** raised from what was seen on site, not a hazard assessment - whether
a sample is actually hazardous comes from the lab results.

- Set or clear it from the **shield** icon on the sample's row. It saves straight
  away, even after dispatch.
- The flag belongs to the **sample**, so it shows as a red **Handle with care** tag
  on every schedule and chain of custody the sample is on, and in the sample picker.
  Hover it to see the note and who flagged it.
- The lab sees it on the paperwork: the PDF Notes cell starts with "Handle with
  care: ...", and the note leads the sample remarks in the AGS and CSV.
- It can also be set from the
  [Table Editor](/manage/table-editor#row-and-location-tools).

## Files

The **Files** section, under Notes, holds the paperwork that goes with the schedule -
the signed schedule copy, the lab's receipt, certificates, results, photos of
damaged samples or the PO. Drag files onto it or choose **Add files**; the file types
and 10 MB limit match the [Media](/manage/media) page. Click a file's name to open
it, or the cross to remove it.

Files save as soon as they upload - no need to press Save - and can be added after
dispatch. They also appear on the project's Media page, tagged with the schedule.
Files are for your team only; clients in Connect do not see them.

## Locking once dispatched

Once a schedule has been dispatched - it has a **Collected** date, or its status is
Collected or later - its **samples, tests, laboratory and reference** are locked,
so the paperwork does not change underneath the lab. A note at the top says when it
was dispatched. Cancelled schedules are never locked.

Everything else stays editable: status, Progress dates and people, lab receipt, PO,
notes, due date, missing marks, tube returns, handle with care and files.

If something does need to change, choose **Unlock to amend** and confirm. The unlock
and every change you then make are recorded in History.

## History

Open a schedule and expand **History** at the bottom to see who changed what and
when, newest first: creation, status changes (including ones that moved on by
themselves from a Progress date), stage dates and people, lab receipt, missing
samples, tube returns, handle with care, files, disposal, unlocks and archiving.
The same entries appear in the audit log in Product OS. History starts from when
this was introduced, so older schedules begin with an empty history.

## Statuses

Schedules use a status list you control. Out of the box it is the standard AGS
testing statuses (**Awaiting start**, **In progress**, **Completed**, **Cancelled**,
**Not received**, **Not required** and **Restricted**) plus the journey statuses
that match the Progress stages (**Samples picked**, **Collected**, **Received by
lab**, **Results received** and **Imported**). In Product OS, under **Labs**, you
can **reorder** them, **rename** the labels, **hide** any you do not use and **add
your own**. Built-in statuses keep their standard AGS code; custom statuses still
export cleanly.

## Export and print

From a schedule's menu, export it as **AGS** (versions 4.0.3 to 4.2.0), **CSV** or
**PDF**, or all three at once with **Export all**. The list shows each schedule's reference, lab, sample and test counts, due
date and status.

**PDF** always uses one of your company's schedule
[templates](/template/samples-and-testing), so it matches what you send the lab. To
send a **paper copy** with the samples, choose **Export PDF**: it opens in a new
tab, ready to print or save. If your company has no schedule template yet, Export PDF is unavailable
until one is set up in Template.

**CSV** downloads a zip with two files: a **summary** (the schedule's general data -
reference, PO, prepared by, issued to, dates, status, stage dates and who did each,
lab receipt and the overall note) and a **details** sheet (one row per sample and
test). Splitting them keeps the details sheet clean for import while still capturing
the header information.

**Export all** downloads one zip holding the AGS file, both CSVs and the PDF, named
as they are when exported one at a time. Choose the AGS version from its menu; if
your company has more than one schedule template, you pick the PDF template too.

**AGS** has no standard headings for some of this, so it goes out as user-defined
**LBSG** headings, declared in the file's DICT group:

| Heading | Holds |
| --- | --- |
| `LBSG_PORF` | PO reference |
| `LBSG_POSD`, `LBSG_PICK`, `LBSG_DISP`, `LBSG_LRCV`, `LBSG_RRCV`, `LBSG_IMPD`, `LBSG_RPTD` | Stage dates: PO sent, samples picked, collected, received by lab, results received, imported and report issued |
| `LBSG_LREF` | Lab receipt ref |
| `LBSG_RCPI`, `LBSG_RCPN` | Receipt issue and its notes |
| `LBSG_RETS`, `LBSG_RETN` | Tubes sent and tubes back |

Notes flow through to the CSV, AGS and PDF: the **per-sample note** and each
**per-test note** appear in the schedule's Notes, led by "Handle with care: ..." or
"Missing: ..." when the sample is flagged. In AGS these are in `LBST_REM`.
