---
title: 801 submission CRUD
summary: Creates, updates, deletes, and retrieves Online 801 submission header rows, including worker-lookup-driven duplicate prevention and a default-status/language cascade for new submissions.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Business.Claim.Entry
reference_type: package
operation_id: OP-CE-12
trigger: cls801Submission CRUD lifecycle and retrieval helpers
---

# 801 submission CRUD

`cls801Submission` is the header object for an Online 801 electronic claim submission — the entry point that ties together worker lookup, submission detail, and eventual ClaimCenter submission. This operation covers its own persistence lifecycle: creation with sensible defaults, insert/update/delete through the `PK82538_ONLINE_801_CLAIM` package, and the block that prevents deleting a submission that has already been sent.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-CE-12 |
| **Trigger** | `cls801Submission` CRUD lifecycle (`BeforeCreate`, `BeforeInsert`, `BeforeUpdate`, `BeforeDelete`) and retrieval helpers |
| **Inputs** | `PolicyNumber`, `ClaimID`/`SubmissionID`, submission header fields (status, language, dates), `LastUpdateNum` |
| **Outputs** | Persisted `CL_801_SUBMISSION` row; a populated or claim-synthesized submission object |
| **Primary components** | `cls801Submission.BeforeCreate`, `cls801Submission.BeforeInsert`, `cls801Submission.BeforeUpdate`, `cls801Submission.BeforeDelete`, `cls801Submission.BeforeRetrieve` |
| **Entry point** | `Business\SAIF.Business.Claim.Entry\Online801\Submission\cls801Submission.vb` |

## Steps

1. **Reserve a submission identifier.** `BeforeCreate` issues a scalar stored-procedure call to obtain the next `SubmissionID` value ([SQL-004](../sql/SQL-004.md)).
2. **Default a new submission** ([BR-CE-021](../business-rules.md#br-ce-021-new-online-801-submissions-default-to-incomplete-status-with-preseeded-language-and-policy-number)). `BeforeCreate`/`AfterCreate` sets the new submission's status to Incomplete, preseeds a default language, and populates `PolicyNumber` from the caller-supplied value.
3. **Insert the submission header.** `BeforeInsert` binds the header fields and issues the insert through `PK82538_ONLINE_801_CLAIM.submission_insert` ([SQL-012](../sql/SQL-012.md), [CL_801_SUBMISSION](../database-tables.md#cl_801_submission)).
4. **Update the submission header under version checking** ([BR-PROC-001](../business-rules.md#br-proc-001-updates-only-succeed-when-the-caller-supplied-lastupdatenum-matches-the-current-row-vers)). `BeforeUpdate` binds `LastUpdateNum` alongside the updated fields; the underlying procedure rejects the update unless the supplied version matches the current row ([SQL-024](../sql/SQL-024.md), [CL_801_SUBMISSION](../database-tables.md#cl_801_submission)).
   - If the rows-affected value is not `1`: add an `UpdateError` broken rule ([BR-CE-011](../business-rules.md#br-ce-011-optimistic-concurrency-update-fails-if-rowsaffected-1)).
5. **Block deletion of a submitted submission** ([BR-CE-020](../business-rules.md#br-ce-020-submitted-online-801-submissions-cannot-be-deleted)). `BeforeDelete` checks the submission's status before deleting; if the submission has already been marked Submitted, the delete is refused with a broken rule rather than being attempted.
6. **Delete the submission header under version checking** ([BR-PROC-002](../business-rules.md#br-proc-002-deletes-only-succeed-when-the-caller-supplied-lastupdatenum-matches-the-current-row-vers)). If the submission is not yet Submitted, `BeforeDelete` binds `LastUpdateNum` and issues the delete through `PK82538_ONLINE_801_CLAIM.submission_delete` ([SQL-028](../sql/SQL-028.md), [CL_801_SUBMISSION](../database-tables.md#cl_801_submission)).
   - If the rows-affected value is not `1`: add a `DeleteError` broken rule ([BR-CE-011](../business-rules.md#br-ce-011-optimistic-concurrency-update-fails-if-rowsaffected-1)).
7. **Retrieve submissions.** `BeforeRetrieve` dispatches to one of several procedure calls depending on the caller's criteria — by submission ID, by claim ID, by policy number, or in a retention-date cleanup mode (`submission_select`, `submission_claim_select`, `submission_policy_select`, `submission_cleanup_select`, `Incomplete_Submission_select`); none of these five call sites are individually catalogued as `SQL-*` documents in this run.*
8. **Delegate worker lookup and claim submission** to the operations documented separately: see [Worker lookup via API](worker-lookup-via-api.md) and [Claim submission via API](claim-submission-via-api.md), both of which are invoked from methods on this same class.

## Process flow

```mermaid
flowchart TD
	Start([Caller manages an<br>Online 801 submission]) --> Mode{Create, update,<br>delete, or retrieve?}
	Mode -->|Create| Seq[Reserve SubmissionID;<br>default status, language, policy number]
	Seq --> Insert[Insert CL_801_SUBMISSION<br>via submission_insert]
	Mode -->|Update| Update[Update row via<br>submission_update, checking LastUpdateNum]
	Update --> URows{RowsAffected = 1?}
	URows -->|No| UConflict([Raise UpdateError])
	URows -->|Yes| UDone([Submission updated])
	Mode -->|Delete| StatusCheck{Status = Submitted?}
	StatusCheck -->|Yes| Blocked([Raise broken rule:<br>cannot delete submitted])
	StatusCheck -->|No| Delete[Delete row via<br>submission_delete, checking LastUpdateNum]
	Delete --> DRows{RowsAffected = 1?}
	DRows -->|No| DConflict([Raise DeleteError])
	DRows -->|Yes| DDone([Submission deleted])
	Mode -->|Retrieve| SelectMode{By ID, claim,<br>policy, or cleanup?}
	SelectMode --> SelectCall[Call matching<br>submission_*_select procedure]
	SelectCall --> Return([Return submission object])
	Insert --> Return
```

## Failure and edge-case behavior

- The five retrieval call sites (`submission_select`, `submission_claim_select`, `submission_policy_select`, `submission_cleanup_select`, `Incomplete_Submission_select`) are not individually catalogued as `SQL-*` documents; they are traced from source call sites rather than linked to numbered SQL catalog entries.*
- The submitted-submission delete block ([BR-CE-020](../business-rules.md#br-ce-020-submitted-online-801-submissions-cannot-be-deleted)) relies on the in-memory status value being current at the time of delete; a stale in-memory object could disagree with the persisted status.*
- Update and delete both apply the same optimistic-concurrency contract ([BR-PROC-001](../business-rules.md#br-proc-001-updates-only-succeed-when-the-caller-supplied-lastupdatenum-matches-the-current-row-vers), [BR-PROC-002](../business-rules.md#br-proc-002-deletes-only-succeed-when-the-caller-supplied-lastupdatenum-matches-the-current-row-vers)), surfacing a broken rule rather than throwing on a version mismatch.

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

## Sources

- `Business\SAIF.Business.Claim.Entry\Online801\Submission\cls801Submission.vb`
