---
id: post/yzhums-com/64474
type: post
title: "Dynamics 365 Business Central: How to check whether the current user has only the Microsoft 365 Plan in AL"
summary: Detect whether a Business Central user has only a Microsoft 365 license by querying the Users In Plans table and checking the Plan ID. This helps apply custom logic or UI changes based on license type, useful since Microsoft 365 plan users can access BC in Teams but encounter errors when accessing directly.
tier: community
language: en
tags:
  - licensing
  - user access
  - microsoft 365
  - al development
  - teams integration
  - user plans
system: administration
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:42:40.248Z"
  flags: []
generated:
  at: "2026-11-21T00:15:56.434Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: bb37dfc0f55b8f4457ee986ecf8bf009ed40ebf6474505a7645eb687ea9c92ae
evidence:
  - kind: blog
    url: https://yzhums.com/64474/
    title: "Dynamics 365 Business Central: How to check whether the current user has only the Microsoft 365 Plan in AL"
    date: "2025-05-28"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/64474/
    title: "Dynamics 365 Business Central: How to check whether the current user has only the Microsoft 365 Plan in AL"
    date: "2025-05-28"
    commit: null
    t: null
    quote: To determine whether the current user is accessing Business Central using only a Microsoft 365 license, the following code snippet can be used
  - kind: blog
    url: https://yzhums.com/64474/
    title: "Dynamics 365 Business Central: How to check whether the current user has only the Microsoft 365 Plan in AL"
    date: "2025-05-28"
    commit: null
    t: null
    quote: Users are entitled to access Business Central data in Microsoft Teams.
  - kind: blog
    url: https://yzhums.com/64474/
    title: "Dynamics 365 Business Central: How to check whether the current user has only the Microsoft 365 Plan in AL"
    date: "2025-05-28"
    commit: null
    t: null
    quote: Meet licensing budget targets by assigning licenses that progressively match employee needs
links:
  learn: []
  objects:
    - object/query/774
    - object/codeunit/9027
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  related:
    - to: post/yzhums-com/77046
      title: "Dynamics 365 Business Central: How to easily check users and their licenses (User Details)"
      label: possibly related
      why: both name Query 774 "Users in Plans"
      by: code
post_id: "64474"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/64474/
published_at: "2025-05-28T01:02:59.000Z"
author: Yun Zhu
full_text: false
words: 710
quotes:
  - text: To determine whether the current user is accessing Business Central using only a Microsoft 365 license, the following code snippet can be used
    why_it_matters: Establishes the core purpose of the technical solution for license type detection
  - text: Users are entitled to access Business Central data in Microsoft Teams.
    why_it_matters: Clarifies the key difference between Microsoft 365 plan users' access capabilities across different interfaces
  - text: Meet licensing budget targets by assigning licenses that progressively match employee needs
    why_it_matters: Explains the business value of distinguishing between license types for cost management
code_objects_mentioned:
  - query Users In Plans
  - codeunit Plan Ids
systems:
  - administration
  - development
versions_mentioned:
  - BC21
  - 2022 wave 2
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2025/05/Snipaste_2025-05-28_09-47-11.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:01.257Z"
---

# Dynamics 365 Business Central: How to check whether the current user has only the Microsoft 365 Plan in AL

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

> Detect whether a Business Central user has only a Microsoft 365 license by querying the Users In Plans table and checking the Plan ID. This helps apply custom logic or UI changes based on license type, useful since Microsoft 365 plan users can access BC in Teams but encounter errors when accessing directly.

## Key points

- Users with only Microsoft 365 licenses can access Business Central through Microsoft Teams but not directly
- Use the Users In Plans query filtered by User Security ID to determine license type
- Check if the user's Plan ID matches the Microsoft 365 Plan ID from the Plan Ids codeunit
- The example page extension demonstrates how to show different messages based on license type
- Licensing is important for cost optimization and data governance in multi-license scenarios

## Quotes

- "To determine whether the current user is accessing Business Central using only a Microsoft 365 license, the following code snippet can be used" (Establishes the core purpose of the technical solution for license type detection)
- "Users are entitled to access Business Central data in Microsoft Teams." (Clarifies the key difference between Microsoft 365 plan users' access capabilities across different interfaces)
- "Meet licensing budget targets by assigning licenses that progressively match employee needs" (Explains the business value of distinguishing between license types for cost management)

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

- [query 774 "Users in Plans"](../../objects/query/774.md)
- [codeunit 9027 "Plan Ids"](../../objects/codeunit/9027.md)

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Dynamics 365 Business Central: How to easily check users and their licenses (User Details)](../../posts/yzhums-com/77046.md) — possibly related: both name Query 774 "Users in Plans"

## Context

- Features: Microsoft 365 plan user detection, License validation, Teams access, User plan identification, Custom logic based on licensing
- Versions: BC21, 2022 wave 2

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.
