---
title: SAIF output-address retrieval
summary: Loads the shared SAIF output-address configuration from LOCATION rows and exposes formatted addresses by destination type.
status: draft
owner: SAIF
last_reviewed: 2026-07-30
library: SAIF.Business
reference_type: package
operation_id: OP-SB-06
trigger: Caller requests the SAIF output-address object.
---

# SAIF output-address retrieval

This operation loads all `XSAIF` `LOCATION` rows into a single `clsSAIFOutputAddress` object. The result centralizes configured output addresses such as return mail, EFT, and customer-service destinations.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SB-06 |
| **Trigger** | Caller invokes `GetSAIFOutputAddresses`. |
| **Inputs** | Data portal info |
| **Outputs** | `clsSAIFOutputAddress` |
| **Primary components** | `clsSAIFOutputAddress.GetSAIFOutputAddresses`, `clsSAIFOutputAddress.Criteria.BeforeRetrieve`, `clsSAIFOutputAddress.AfterRetrieve`, `clsSAIFOutputAddress.GetFormattedAddress` |
| **Entry point** | `Business\SAIF.Business\clsSAIFOutputAddress.vb` |

## Steps

1. `GetSAIFOutputAddresses` creates criteria for the fixed company code `XSAIF` and submits a retrieval request.
2. The criteria query every `LOCATION` row for that company and return the ordered result set to the business object ([SQL-033](../sql/SQL-033-saif-output-address-retrieval.md), [LOCATION](../database-tables.md#location)).
3. `AfterRetrieve` iterates through the returned rows, maps each location name to the library's address-description enum, and stores the corresponding `clsAddress` object in the address dictionary ([SQL-033](../sql/SQL-033-saif-output-address-retrieval.md), [LOCATION](../database-tables.md#location)).
4. The object marks itself invalid when no qualifying rows were returned, enforcing the requirement that at least one `XSAIF` address must exist ([BR-SB-009](../business-rules.md#br-sb-009-saif-output-address-retrieval-requires-at-least-one-location-row-for-xsaif)).
5. Consumers call `GetAddress` or `GetFormattedAddress` to retrieve either the structured `clsAddress` or a newline-formatted mailing block for a specific destination.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([Output-address request]) --> Query[Query LOCATION rows for XSAIF]
    Query --> Rows{Rows returned?}
    Rows -->|No| Invalid([Return invalid object])
    Rows -->|Yes| Map[Map rows to address descriptions]
    Map --> Format[Expose structured or formatted addresses]
    Format --> End([Return output-address object])
```

## Failure and edge-case behavior

- When the query returns no `XSAIF` rows, the object is invalid by design ([BR-SB-009](../business-rules.md#br-sb-009-saif-output-address-retrieval-requires-at-least-one-location-row-for-xsaif)).
- Unknown or unmapped location descriptions are ignored unless the caller requests that specific address later.

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

## Sources
- `Business\SAIF.Business\clsSAIFOutputAddress.vb`
