---
id: post/aardvarklabs-blog/2816
type: post
title: "Understanding AL Development: Environmental Information Code Unit"
summary: Codeunit 457 Environment Information provides methods to detect deployment type, environment type, and application family in AL extensions. It helps developers run different code paths for production versus sandbox environments, such as redirecting emails in sandbox to safe addresses instead of real clients.
tier: community
language: en
tags:
  - al development
  - codeunit
  - environment detection
  - sandbox testing
  - extension development
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T01:58:21.791Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 5586a41f18ab2779b77a4dd99bca425a147d9c24ebeb4edceb21a2e051dc3362
evidence:
  - kind: blog
    url: https://aardvarklabs.blog/2025/11/07/understanding-al-development-environmental-information-code-unit/
    title: "Understanding AL Development: Environmental Information Code Unit"
    date: "2025-11-07"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://aardvarklabs.blog/2025/11/07/understanding-al-development-environmental-information-code-unit/
    title: "Understanding AL Development: Environmental Information Code Unit"
    date: "2025-11-07"
    commit: null
    t: null
    quote: There are cases where we want some different behavior depending on specific environmental details.
  - kind: blog
    url: https://aardvarklabs.blog/2025/11/07/understanding-al-development-environmental-information-code-unit/
    title: "Understanding AL Development: Environmental Information Code Unit"
    date: "2025-11-07"
    commit: null
    t: null
    quote: If someone makes a copy of the Production environment to a Sandbox, we want to change this behavior.
links:
  learn: []
  objects:
    - object/codeunit/457
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "2816"
source_id: aardvarklabs-blog
source_name: Aardvark Labs
url: https://aardvarklabs.blog/2025/11/07/understanding-al-development-environmental-information-code-unit/
published_at: "2025-11-07T13:00:00.000Z"
author: Marcel Chabot
full_text: false
words: 381
quotes:
  - text: There are cases where we want some different behavior depending on specific environmental details.
    why_it_matters: Explains why developers need to detect and respond to environment differences in their code
  - text: If someone makes a copy of the Production environment to a Sandbox, we want to change this behavior.
    why_it_matters: Illustrates the critical security use case of preventing unintended operations like sending real emails from sandbox copies
code_objects_mentioned:
  - codeunit Environment Information
systems:
  - development
  - platform
versions_mentioned: []
preview:
  embeddable: true
  frame_url: https://aardvarklabs.blog/2025/11/07/understanding-al-development-environmental-information-code-unit/embed/
  image: https://aardvarklabs.blog/wp-content/uploads/2025/09/da2652b0-4de8-4f01-be35-2743fb95bb3a.jpeg
  image_alt: null
  image_w: 1024
  image_h: 1024
  site_name: Aardvark Labs
  favicon: https://aardvarklabs.blog/wp-content/uploads/2024/04/design-1.png?w=32
  probed_at: "2026-10-07T11:51:22.471Z"
---

# Understanding AL Development: Environmental Information Code Unit

[Read the post](https://aardvarklabs.blog/2025/11/07/understanding-al-development-environmental-information-code-unit/) · Aardvark Labs (Marcel Chabot) · 2025-11-07 · 381 words · tier community · reviewed (checked by Opus)

> Codeunit 457 Environment Information provides methods to detect deployment type, environment type, and application family in AL extensions. It helps developers run different code paths for production versus sandbox environments, such as redirecting emails in sandbox to safe addresses instead of real clients.

## Key points

- Codeunit 457 Environment Information exposes methods like IsProduction, IsSandbox, IsSaaS, IsOnPrem, and IsFinancials to check environment characteristics
- IsProduction and IsSandbox are useful for gating operations, such as skipping email sends or redirecting to test addresses in sandbox
- IsSaaSInfrastructure distinguishes between SaaS infrastructure hosting and Docker testing environments, returning false in Docker
- CanStartSession checks if a new session can be started via Session.StartSession for multi-session processing
- Common use case is preventing sensitive operations like sending remittance notices to real customers when a production environment copy exists in sandbox

## Quotes

- "There are cases where we want some different behavior depending on specific environmental details." (Explains why developers need to detect and respond to environment differences in their code)
- "If someone makes a copy of the Production environment to a Sandbox, we want to change this behavior." (Illustrates the critical security use case of preventing unintended operations like sending real emails from sandbox copies)

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

- [codeunit 457 "Environment Information"](../../objects/codeunit/457.md)

## Context

- Features: environment type detection, sandbox vs production checks, SaaS infrastructure detection, on-premises detection, application family identification, environment name retrieval, linked Power Platform environment detection

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