---
title: Retrieve the most recent premium set for a policy period
summary: Retrieve most recent premium set.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Premium
reference_type: package
operation_id: OP-001
trigger: Caller needs the current premium picture for a policy period
---

# Retrieve the most recent premium set for a policy period

Caller needs the current premium picture for a policy period

| Field | Value |
| --- | --- |
| **Operation ID** | OP-001 |
| **Trigger** | Caller needs the current premium picture for a policy period |
| **Inputs** | Policy number, policy period effective date, database selection (PremiumSetDatabases)* |
| **Outputs** | A populated clsPremiumSet, or a "new"/empty instance when no row exists* |
| **Primary components** | `clsPremiumSet.GetMostRecentPremiumSet (two overloads)` |
| **Entry point** | `Business\SAIF.Business.Policy.Premium\clsPremiumSet.vb` |

## Steps

1. The caller invokes the shared factory `GetMostRecentPremiumSet`, supplying policy identity and the target database.
2. A nested `Criteria` instance is built with `RetrievalMode = RetrievalModes.MostRecent`, which selects the "most recent" variant of the retrieve SQL. *(SQL: `PREM_HIST_SUMMARY` or `PREM_HIST_SUMMARY_VIEW@POLDB` depending on database selection.)*
3. `BeforeRetrieve` obtains a data request via `DAL.GetPortalRequest(inDpi.PortalID)` (`clsPremiumSet.vb:676`), sets the criteria `RetrieveSQL`, and adds parameters via `AddParm`.
4. `ProcessPortalRequest` executes the request against Oracle.
5. `AfterRetrieve` calls `Fill()` to populate properties from the returned reader and `MarkOld()` to reset the dirty/new state.
6. Branch/error: if no row is returned, the object remains new; callers are expected to test the new/valid state before use.*

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid

flowchart TD

    Start([Trigger]) --> S1[Step 1]

    S1 --> S2[Step 2]

    S2 --> EndOk([Outputs returned])

```

## Failure and edge-case behavior

- See the linked rules and SQL references above for validation failures, null-handling, and persistence contention behavior.

## Related documentation

- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources

- `Business\SAIF.Business.Policy.Premium\clsPremiumSet.vb`
