---
id: post/yzhums-com/63644
type: post
title: "Dynamics 365 Business Central: How to show a warning about low inventory on a sales document (Prohibit users from adding sales lines with low inventory)"
summary: Business Central offers a built-in Stockout Warning toggle to notify users when sales document quantities exceed inventory levels. For stricter control, customization using codeunit 311 event subscribers can prevent sales line creation when inventory is insufficient.
tier: community
language: en
tags:
  - inventory management
  - sales orders
  - stock availability
  - low inventory warning
  - customization
system: sales
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:42:40.279Z"
  flags: []
generated:
  at: "2026-10-26T05:51:10.938Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: adb91449a2ce4eb72cb25423a33896a4e28becd04704a3a99fbef9dbf3fb06b4
evidence:
  - kind: blog
    url: https://yzhums.com/63644/
    title: "Dynamics 365 Business Central: How to show a warning about low inventory on a sales document (Prohibit users from adding sales lines with low inventory)"
    date: "2025-05-23"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/63644/
    title: "Dynamics 365 Business Central: How to show a warning about low inventory on a sales document (Prohibit users from adding sales lines with low inventory)"
    date: "2025-05-23"
    commit: null
    t: null
    quote: The notification is just to inform them of the potential problem, and doesn't prevent them from creating the order or posting the order.
  - kind: blog
    url: https://yzhums.com/63644/
    title: "Dynamics 365 Business Central: How to show a warning about low inventory on a sales document (Prohibit users from adding sales lines with low inventory)"
    date: "2025-05-23"
    commit: null
    t: null
    quote: If you want to prohibit users from adding sales lines with low inventory, this can only be done through customization as of now.
links:
  learn: []
  objects:
    - object/codeunit/311
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "63644"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/63644/
published_at: "2025-05-23T01:13:57.000Z"
author: Yun Zhu
full_text: false
words: 437
quotes:
  - text: The notification is just to inform them of the potential problem, and doesn't prevent them from creating the order or posting the order.
    why_it_matters: Clarifies the limitation of the standard feature and the need for customization to enforce restrictions
  - text: If you want to prohibit users from adding sales lines with low inventory, this can only be done through customization as of now.
    why_it_matters: Explains when and why developers need to implement custom code using event subscribers
code_objects_mentioned:
  - codeunit Item-Check Avail.
  - codeunit ItemAvailabilityHandler
systems:
  - sales
  - inventory
versions_mentioned: []
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2025/05/image-151.png
  image_alt: null
  image_w: null
  image_h: null
  site_name: Dynamics 365 Lab
  favicon: https://yzhums.com/wp-content/uploads/2020/08/cropped-logo-3-32x32.png
  probed_at: "2026-10-26T06:20:12.489Z"
---

# Dynamics 365 Business Central: How to show a warning about low inventory on a sales document (Prohibit users from adding sales lines with low inventory)

[Read the post](https://yzhums.com/63644/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2025-05-23 · 437 words · tier community · reviewed (checked by Opus)

> Business Central offers a built-in Stockout Warning toggle to notify users when sales document quantities exceed inventory levels. For stricter control, customization using codeunit 311 event subscribers can prevent sales line creation when inventory is insufficient.

## Key points

- Enable Stockout Warning in Sales & Receivables Setup to display notifications when inventory goes negative
- The standard warning only informs users and does not prevent order creation or posting
- Prohibit users from adding sales lines with low inventory by subscribing to the OnShowWarningOnAfterCalculate event in codeunit 311
- Custom code can raise an error to block sales line entry when available inventory plus net change is negative

## Quotes

- "The notification is just to inform them of the potential problem, and doesn't prevent them from creating the order or posting the order." (Clarifies the limitation of the standard feature and the need for customization to enforce restrictions)
- "If you want to prohibit users from adding sales lines with low inventory, this can only be done through customization as of now." (Explains when and why developers need to implement custom code using event subscribers)

## 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 311 "Item-Check Avail."](../../objects/codeunit/311.md)
- codeunit "ItemAvailabilityHandler"

Not found in BC28-30: codeunit "ItemAvailabilityHandler".

## Context

- Features: Stockout Warning, availability check, inventory notifications, sales document validation

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
