---
title: "SQL-013: Retrieve active application codes"
summary: Retrieves all active BUSONLINE_APPS_CODE records filtered by ACTIVE_CODE.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Menu
reference_type: package
---

# SQL-013: Retrieve active application codes

Retrieves all application code records where `NVL(ACTIVE_CODE, 'Y') = 'Y'`, enforcing [BR-MNU-03](../business-rules.md#br-mnu-03-active-application-code-filtering). Records with a null `ACTIVE_CODE` are treated as active.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-013 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsApplicationCodeCollection` |
| **Criteria property** | `RetrieveActiveSQL` |
| **Lifecycle method** | `BeforeRetrieve` (ActiveOnly=True) / `AfterRetrieve` |

## Parameters

No parameters.

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [BUSONLINE_APPS_CODE](../database-tables.md#busonline-apps-code) | SELECT | `CODE`, `CODE_DESCR`, `ACTIVE_CODE` |

## Sample SQL

```sql
SELECT CODE as Code,
       CODE_DESCR as ApplicationPath,
       NVL(ACTIVE_CODE,'Y') as ActiveFlag
FROM BUSONLINE_APPS_CODE
WHERE NVL(ACTIVE_CODE, 'Y') = 'Y'
```

## Operations and processes
- [Application code scoping](../operations/application-code-scoping.md)

## Business rules
- [BR-MNU-03: Active application code filtering](../business-rules.md#br-mnu-03-active-application-code-filtering)


> **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.Menu\clsApplicationCodeCollection.vb`
