---
title: Create and persist a chapter
summary: Create a chapter in memory or retrieve one chapter as of a date.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Group
reference_type: package
operation_id: OP-005
trigger: —
---

# Create and persist a chapter

Creates a chapter object with criteria-derived keys and supports date-effective retrieval, but compiled source does not contain chapter persistence SQL.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-005 |
| **Trigger** |  |
| **Inputs** | — |
| **Outputs** | A seeded chapter object or a retrieved effective chapter row. |
| **Primary components** | `clsChapter.NewChapter`, `clsChapter.GetChapter` |
| **Entry point** | `Business\SAIF.Business.Policy.Group\clsChapter.vb` |

## Steps

1. `NewChapter(dpi, groupAssociationCode, code)` calls `CreateObject`; `Create()` copies `GroupAssociationCode` and `Code` from the criteria and calls **`MarkClean()`**. ([BR-007](../business-rules.md#br-007-new-chapter-seeds-key-values-and-starts-clean))
   - Persistence note: compiled source contains no live chapter insert, update, or delete SQL, so the object can be created in memory but not saved by this library.
2. `GetChapter(dpi, groupAssociationCode, code, selectDate)` retrieves a chapter as of a date — the criteria carries a `SelectDate` used by `RetrieveSQL` to pick the effective row. ([BR-008](../business-rules.md#br-008-chapter-retrieval-is-as-of-date-effective))
3. Insert/update/delete follow the standard `Before*`/`After*` row-count pattern against `GROUP_CHAPTER`.
4. Database statements executed or relied on by this operation: [SQL-017](../sql/SQL-017-saif-business-policy-group.md); affected tables: [GROUP_CHAPTER](../database-tables.md#group_chapter).

## 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

- The retrieve path is date-effective through [SQL-017](../sql/SQL-017-saif-business-policy-group.md), but there is no compiled write SQL for chapters.**

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