# Important Lot Functions

| Function | What it does |
|---|---|
| `system.kanoa.lot.executeLotOperation` | Creates a lot operation event with all its input and output lot events in one call, so the genealogy is never left half-written |
| `system.kanoa.lot.getLotActivity` | Returns the lots that currently have material, with quantity by asset and state, filtered by asset, lot name, transport and more |

A transfer screen uses both in a loop:

1. The user picks a source asset, and `getLotActivity` lists the lots there.
2. The user picks a lot, a quantity and a destination.
3. `executeLotOperation` runs a `Transfer`: an input at the source and an output at the destination.
4. The screen calls `getLotActivity` again to refresh.

A receiving screen only needs the second function: an operation with no inputs and one output.

:::tip[Building your own screen]
Run the operation by hand in Lot Manager first. Note its inputs and outputs, build the same payload in your script, check quantities before you call `executeLotOperation`, and show a clear success or error message.
:::

::embed-section{src="../../../systemFunctions/lot/executeLotOperation.md" collapsed="true" summary="Reference Materials: executeLotOperation"}

::embed-section{src="../../../systemFunctions/lot/getLotActivity.md" collapsed="true" summary="Reference Materials: getLotActivity"}
