---
id: post/nataliekarolak-com/1855
type: post
title: "Snippet: StrMenu from Enum list"
summary: This post demonstrates an AL code snippet that uses StrMenu to let users select from a filtered subset of enum values dynamically, useful when all enum values should be visible normally but only certain values are allowed in specific scenarios.
tier: community
language: en
tags:
  - al development
  - enums
  - user interaction
  - strmenu
  - code snippet
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-25T18:23:14.380Z"
  flags: []
generated:
  at: "2026-10-25T18:17:26.277Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: a1ebca8cb64bfbc0db4469ba2692eec6d0cfe8dd5e2e46fff71b5cff7f037ac6
evidence:
  - kind: blog
    url: https://nataliekarolak.wordpress.com/2025/07/02/snippet-strmenu-from-enum-list/
    title: "Snippet: StrMenu from Enum list"
    date: "2025-07-02"
    commit: null
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "1855"
source_id: nataliekarolak-com
source_name: The BC Docs Librarian
url: https://nataliekarolak.wordpress.com/2025/07/02/snippet-strmenu-from-enum-list/
published_at: "2025-07-02T08:24:26.000Z"
author: Natalie Karolak
full_text: false
words: 227
quotes: []
code_objects_mentioned:
  - enum My Enum
systems:
  - development
versions_mentioned: []
preview:
  embeddable: true
  frame_url: https://nataliekarolak.wordpress.com/2025/07/02/snippet-strmenu-from-enum-list/embed/
  image: https://nataliekarolak.wordpress.com/wp-content/uploads/2022/11/cropped-logo-216x216-1.png?w=200
  image_alt: null
  image_w: 200
  image_h: 200
  site_name: The BC Docs Librarian
  favicon: https://nataliekarolak.wordpress.com/wp-content/uploads/2022/11/cropped-logo-216x216-1.png?w=32
  probed_at: "2026-10-25T18:22:00.498Z"
---

# Snippet: StrMenu from Enum list

[Read the post](https://nataliekarolak.wordpress.com/2025/07/02/snippet-strmenu-from-enum-list/) · The BC Docs Librarian (Natalie Karolak, MVP) · 2025-07-02 · 227 words · tier community · reviewed (checked by Opus)

> This post demonstrates an AL code snippet that uses StrMenu to let users select from a filtered subset of enum values dynamically, useful when all enum values should be visible normally but only certain values are allowed in specific scenarios.

## Key points

- Uses a List to collect allowed enum values dynamically rather than statically defining them on a page field
- Automatically selects and returns the only value if the filtered list contains just one item
- Formats enum values for the StrMenu by converting them to text and handling comma separators
- Returns an error if no values are found or if the user cancels the menu selection

## AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

- enum "My Enum"

Not found in BC28-30: enum "My Enum".

## Context

- Features: StrMenu, Enum filtering, List collection, Dynamic value selection

Source: The BC Docs Librarian, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
