# Chain of custody

> Raise a chain of custody record to track samples to the laboratory.

A **chain of custody** record tracks which samples were dispatched, to whom and
when - the paper trail from site to laboratory.

## Raise a record

Choose **New chain of custody** and fill in the builder:

<Steps>
  <Step title="Reference and lab">
    Give it a **reference** and choose the **laboratory** it is dispatched to.
  </Step>
  <Step title="Dispatch details">
    Set **dispatched from**, the **date dispatched**, a **batch reference**, a
    **status** and any remarks. **Dispatched to** is optional - it defaults to the
    chosen laboratory; fill it in only to name a specific contact or site.
  </Step>
  <Step title="Samples">
    Pick the **samples** and, for each, the number of **containers** and any notes.
    The picker has a quick **search**, per-column **filters** and click-to-**sort**
    headers to manage long lists.
  </Step>
</Steps>

Samples that have **already been sent to the lab** on another chain of custody are
flagged with an amber warning - in the picker and above the sample list - naming the
record they are on, so you do not dispatch the same sample twice. It is a warning,
not a block.

Samples flagged **Handle with care** show a red tag - hover it to see the note and
who flagged it. The flag is set on a
[testing schedule](/manage/lab-workflow/testing-schedules#handle-with-care) or in the
Table Editor, and is read-only here. It also leads the sample's remarks on the
exports.

## Locking once dispatched

Once a record has a **date dispatched**, its sample list is locked so the paperwork
does not change underneath the lab. If something does need to change, choose
**Unlock to amend** and confirm.

## Files

The **Files** section holds the paperwork that goes with the record, such as the
courier-signed copy or the lab's receipt. It works the same way as
[files on a schedule](/manage/lab-workflow/testing-schedules#files): files save as
soon as they upload, can be added after dispatch, appear on the project's
[Media](/manage/media) page tagged with the record, and are not shown to clients.

## Statuses

Chain of custody records move through **Draft**, **Issued**, **Received** and
**Complete**.

## Export

From a record's menu, export it as **AGS**, **CSV** or **PDF**. The PDF always uses
one of your company's chain of custody [templates](/template/samples-and-testing);
if there is none yet, Export PDF is unavailable until one is set up in Template. The list shows each record's reference, where it was
dispatched to, sample count, dispatch date and status. Per-sample notes appear in
both the CSV and the PDF Notes column, led by "Handle with care: ..." when the
sample is flagged (in AGS, `CHOC_REM`).
