---
title: Help text retrieval
summary: Loads single help-text rows or application-scoped help-text collections from the application help tables.
status: draft
owner: SAIF
last_reviewed: 2026-07-30
library: SAIF.Business
reference_type: package
operation_id: OP-SB-04
trigger: Caller requests help text by reference key or application code.
---

# Help text retrieval

This operation exposes the application help content stored in `APPLICATION_HELP_DETAIL` and `APPLICATION_HELP_MASTER`. The library supports both single-row retrieval by reference key and broader collection retrieval by application code.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SB-04 |
| **Trigger** | Caller invokes `GetHelpText` or `GetHelpTextCollection`. |
| **Inputs** | Reference key value or application code |
| **Outputs** | `clsHelpText` or `clsHelpTextCollection` |
| **Primary components** | `clsHelpText.GetHelpText`, `clsHelpText.Criteria.BeforeRetrieve`, `clsHelpTextCollection.Criteria.BeforeRetrieve` |
| **Entry point** | `Business\SAIF.Business\clsHelpText.vb` |

## Steps

1. A single-help-text request creates `clsHelpText.Criteria` with the reference key value supplied by the caller.
2. `BeforeRetrieve` builds the detail lookup against `APPLICATION_HELP_DETAIL` and binds the requested reference key into the SQL ([SQL-029](../sql/SQL-029-help-text-retrieval.md), [APPLICATION_HELP_DETAIL](../database-tables.md#application-help-detail)).
3. After retrieval, the object copies the row's help-text fields into the business object and returns it to the caller.
4. A collection request creates `clsHelpTextCollection.Criteria` with an application code rather than a reference key.
5. The collection criteria build a join between `APPLICATION_HELP_MASTER` and `APPLICATION_HELP_DETAIL`, filter the row set to the requested application code, and order the result for presentation ([SQL-030](../sql/SQL-030-help-text-collection-retrieval.md), [APPLICATION_HELP_MASTER](../database-tables.md#application-help-master), [APPLICATION_HELP_DETAIL](../database-tables.md#application-help-detail)).
6. `AfterRetrieve` turns each joined row into a `clsHelpText` item and returns the populated collection.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([Help-text request]) --> Type{Single key or collection?}
    Type -->|Single| Single[Query help detail by key]
    Type -->|Collection| Collection[Join help master and detail by application]
    Single --> Return1([Return help-text object])
    Collection --> Return2([Return help-text collection])
```

## Failure and edge-case behavior

- A missing reference key or application code yields no result rows and therefore returns an empty object or collection.
- The library performs no write path for help text; it only reflects what is already present in the help tables.

## 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\clsHelpText.vb`
- `Business\SAIF.Business\clsHelpTextCollection.vb`
