web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Extending codeunits in business central

(6) ShareShare
ReportReport
Posted on by 436

Hello community, 

I want to ask that if I want to extend codeunits in business central how can I do that as there is no code snippet for code unit extension. 

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    61,180 Super User 2026 Season 1 on at

    We have to create subscribers based on the publishers available in the codeunits.

    learn.microsoft.com/.../devenv-events-in-al

  • Muhammad Anas Naeemi Profile Picture
    436 on at

    Do you have any set of code for example?

  • Verified answer
    pankaj.k Profile Picture
    1,018 on at

    Hi Muhammad Anas Naeemi,

    check the below link  mohana Yadav already answered the question.

    https://community.dynamics.com/nav/f/microsoft-dynamics-nav-forum/218269/modify-standard-codeunit-using-extensions/582548

    For more detail please share the Codeunit ID and explain what you  want to customize.

  • Verified answer
    YUN ZHU Profile Picture
    98,128 Super User 2026 Season 1 on at

    Hi, unfortunately, you cannot extend codeunit in Business Central.

    But you can modify some default behaviors, as long as the standard reserves Event for us.

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-events-in-al

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    CU23011707-0 Profile Picture
    2 on at

    Hi Muhammad Anas Naeemi,

    It is not possible in Business Central to extend a standard codeunit directly, as this can break the execution flow and is not supported by Microsoft.

    The recommended approach is to use Event Subscribers. Microsoft exposes events in standard codeunits that allow you to run custom logic before or after standard processing without modifying the base code.

    You can refer to this detailed explanation and example here:

    https://scrutnlearn.com/business-central-tutorial/how-to-extend-codeunits.html

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,964 Super User 2026 Season 1

#2
Dhiren Nagar Profile Picture

Dhiren Nagar 1,086 Super User 2026 Season 1

#3
YUN ZHU Profile Picture

YUN ZHU 1,039 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans