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 :
Business Central forum

Adding Code to Standard Codeunits in Business Central.

(0) ShareShare
ReportReport
Posted on by 245

Hello All , I need to add my custom code in standard codeunits in Business Central , can any one suggest me how can i add code to standard codeunits in Business central.

  • Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    This is not possible in the SaaS environment, you need to subscribe to standard events (with EventSubscriber definitions) for customizing code.

    On-premise you can still modify standard objects as before.

  • Manikanta_501 Profile Picture
    245 on at

    Actually I am working on Upgradation from NAV 2017 to Business Central , in NAV 2017 i have custom functions in Standard Codeunit (Sales-post) now i want to add that custom(functions) code to Business Central.

  • Manikanta_501 Profile Picture
    245 on at

    I have custom functions in " Sales-Post Codeunit(80) " NAV 2017 ,And now I need to add them in Business Central Sales-Post Codeunit.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Are you talking about Business Central on-premise or SaaS?

    If on-premise, you can still modify the standard object via CSIDE and add your code in the standard codeunits. In a SaaS environment you can't do that, you cannot modify standard code. You need to check your standard codeunit and detect where you have placed custom code, then use standard events raised by D365BC on that codeunit and subscribe to them.

  • Manikanta_501 Profile Picture
    245 on at

    I am Working with Saas , Can I add my Custom function after last Integration Event provided by D365BC.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    If this is the right point for you, the answer is yes. You need to subscribe the right event where you want to place your custom code.

  • Manikanta_501 Profile Picture
    245 on at

    I got it.

    Thank you.

  • anandb313@gmail.com Profile Picture
    200 on at

    Can i simply view the Codeunit? like I need to see a  Codeunit 80 in visual studio code ? Is it possible in Business central?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Yes. You can have the complete .al files of the standard base application by unzipping the Base Application .app file (downloaded from symbols) or by extracting them from a Docker container or by retrieving them from the D365BC DVD package (for onpremise).

  • Suggested answer
    Mohana Yadav Profile Picture
    61,250 Super User 2026 Season 2 on at

    yes, you can declare it as a variable and use go to definition.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans