---
title: Resolve the user's preference store
summary: Construct the `clsPreferences` instance used to read and write the `SHOWAPPS` layout preference, or determine that preferences are unavailable.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.V2.Menu
reference_type: package
operation_id: OP-MENU-008
trigger: "`SAIFMenu.Preferences` property access (called from [Restore menu state on page pre-load](restore-menu-state-on-page-pre-load.md) and [Expand or collapse the applications section](expand-or-collapse-the-applications-section.md))."
---

# Resolve the user's preference store

Construct the `clsPreferences` instance used to read and write the `SHOWAPPS` layout preference, or determine that preferences are unavailable. This operation is implemented by `SAIFMenu.Preferences`.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-MENU-008 |
| **Trigger** | `SAIFMenu.Preferences` property access (called from [Restore menu state on page pre-load](restore-menu-state-on-page-pre-load.md) and [Expand or collapse the applications section](expand-or-collapse-the-applications-section.md)). |
| **Inputs** | `HttpContext.Current.User.Identity.Name`. |
| **Outputs** | A `clsPreferences` instance scoped to `<username>`/`BOMENU`, or `Nothing`. |
| **Primary components** | `SAIFMenu.Preferences` |
| **Entry point** | `SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenu.vb` |

## Steps

1. Split `HttpContext.Current.User.Identity.Name` on `\`. Enforces [BR-MENU-041](../business-rules.md#br-menu-041-preferences-are-keyed-by-the-user-name-portion-of-domainuser).
2. Only when the split yields exactly two parts, construct `New clsPreferences(<username>, "BOMENU")`; otherwise the property returns `Nothing` and all preference handling is skipped. Enforces [BR-MENU-042](../business-rules.md#br-menu-042-preferences-are-stored-under-the-fixed-application-code-bomenu), [BR-MENU-043](../business-rules.md#br-menu-043-preference-handling-is-skipped-for-non-domainuser-identities).
   - Delegates to `clsPreferences` (`SAIF.Presentation`), which opens an Oracle data layer as DB user `CLM`.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["SAIFMenu.Preferences property access"]) --> Split["Split User.Identity.Name on backslash"]
	Split --> Check{Exactly two parts?}
	Check -->|Yes| Construct(["New clsPreferences(username, 'BOMENU')"])
	Check -->|No| Nothing(["Return Nothing; preference handling skipped"])
```

## Failure and edge-case behavior

- Identity not in `DOMAIN\user` form (0 or 1 parts, or more than 2): property returns `Nothing`; callers must null-check before using it ([BR-MENU-043](../business-rules.md#br-menu-043-preference-handling-is-skipped-for-non-domainuser-identities)).

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

## Sources
- `SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenu.vb`
