---
title: Retrieve a group association
summary: Retrieve one group master record by group code.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Group
reference_type: package
operation_id: OP-001
trigger: Caller needs a single group's master record
---

# Retrieve a group association

Loads one group association row and exposes its typed group classification plus lazy child accessors.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-001 |
| **Trigger** | Caller needs a single group's master record |
| **Inputs** | `IDataPortalInfo`, group code |
| **Outputs** | A populated `clsGroupAssociation` marked old. |
| **Primary components** | `clsGroupAssociation.GetGroupAssociation` |
| **Entry point** | `Business\SAIF.Business.Policy.Group\clsGroupAssociation.vb` |

## Steps

1. Construct `New Criteria(dpi, inGroupCode)` and call `dpi.DataAccessLayer.RetrieveObject`.
2. `BeforeRetrieve` builds a result-set request with `ID = clsConstants.RetrieveSQL`, `SQLStatement = MyCriteria.RetrieveSQL`, and binds `:Code`.
3. The framework executes the SELECT against `GROUP_ASSOCIATION`.
4. `AfterRetrieve` reads the first row into the object via `Fill(datareader)` and calls `MarkOld()`.
5. `AddBusinessRules` has registered [BR-001](../business-rules.md#br-001-group-association-code-is-required) (`ValidGroupAssociation`) on `Code`.
6. Database statements executed or relied on by this operation: [SQL-021](../sql/SQL-021-saif-business-policy-group.md); affected tables: [GROUP_ASSOCIATION](../database-tables.md#group_association).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([Trigger]) --> Step1[Build criteria / load state]
    Step1 --> Step2[Apply local business logic]
    Step2 --> Decision{Valid and complete?}
    Decision -->|Yes| Step3[Return data or persist rows]
    Decision -->|No| EndErr([Return BOF validation or SQL-state issues])
    Step3 --> EndOk([Operation completes])
```

## Failure and edge-case behavior

- Earlier analysis described the retrieve bind as `:Code`, but [SQL-021](../sql/SQL-021-saif-business-policy-group.md) binds `:GroupCode`; the naming discrepancy remains open.**

## 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.Group\clsGroupAssociation.vb`
