---
title: Retrieve producers
summary: Load one producer or a producer collection from AGENT.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Agency
reference_type: package
operation_id: OP-009
trigger: A caller requests one producer or all producers for an agency.
---

# Retrieve producers

This operation retrieves producer rows from `AGENT` by key or by agency scope and exposes the resulting objects for identity and activity checks.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-009 |
| **Trigger** | A caller invokes `clsProducer.GetProducer` or `clsProducerCollection.GetProducerCollection`. |
| **Inputs** | `IDataPortalInfo`, agent number and/or agency sequence number |
| **Outputs** | `clsProducer` or `clsProducerCollection` |
| **Primary components** | `clsProducer`, `clsProducerCollection`, nested `Criteria` classes |
| **Entry point** | `Business\SAIF.Business.Policy.Agency\clsProducer.vb`, `Business\SAIF.Business.Policy.Agency\clsProducerCollection.vb` |

## Steps
1. Build either a single-object criteria keyed by agent number or a collection criteria with an optional agency sequence number.
2. Pass the criteria through the BOF retrieve lifecycle ([BR-024](../business-rules.md#br-024-the-library-is-retrieve-only)).
3. For single-object retrieval, execute [SQL-007](../sql/SQL-007-retrieve-producer-by-agent-number.md) against [AGENT](../database-tables.md#agent).
4. For collection retrieval, execute [SQL-009](../sql/SQL-009-retrieve-producers.md), binding `:AgencySeqNum` only when the collection is scoped to one agency.
5. Hydrate one producer or many producers from the returned reader; missing keyed rows remain default-initialized ([BR-001](../business-rules.md#br-001-missing-key-retrieval-returns-a-default-object)).
6. Expose the loaded rows for active-date checks and agency-self detection ([BR-008](../business-rules.md#br-008-active-status-uses-effective-and-expiration-windows), [BR-023](../business-rules.md#br-023-producer-agencies-are-detected-when-agency-sequence-number-equals-agent-number), [BR-025](../business-rules.md#br-025-identity-keys-are-agency-seq-contract-seq-and-agent-number)).

## Process flow

The following diagram visualizes the producer retrieve paths.

```mermaid
flowchart TD
  Start([Producer request]) --> Type{Single or collection?}
  Type -->|Single| One[Run SQL-007]
  Type -->|Collection| Many[Run SQL-009]
  One --> FillOne[Fill clsProducer]
  Many --> FillMany[Load producer collection]
  FillOne --> End([Producers returned])
  FillMany --> End
```

## Failure and edge-case behavior
- Missing keyed rows return a default-initialized producer object.
- The unscoped collection path reads all producer rows.

## Related documentation
- [Index](../index.md)
- [Overview](../overview.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Database tables](../database-tables.md)
- [SQL catalog](../sql/index.md)
- [API reference](../api/index.md)

## Sources
- `Business\SAIF.Business.Policy.Agency\clsProducer.vb`
- `Business\SAIF.Business.Policy.Agency\clsProducerCollection.vb`
