Skip to main content

Time to Say Good Bye for Codeunit 1.

Hi all,

We all have used Codeunit 1 "ApplicationManagement" some way or other. It was used for so many customizations till NAV 2018 using Codeunit 1.

Remember - Report Logger, ChangeLog, Checking Build Number,  System Indicators, DateText Functions, and others that we would have used in Codeunit 1.



But Microsoft decided to drop codeunit 1 going forward with Business Central Release and it's not a bug.

So what happens to our functions that we were using. Don't worry Microsoft have moved those function to other code units which can be rewritten during an upgrade to business Central.

Few other updates - 
1. New ‘system’ codeunits have been introduced in the 2 billion range.
2. These special codeunits are created by C/SIDE when a database is created automatically.
3. These new system codeunits do not contain code, all they contain are event publishers.
4. Microsoft added subscribers to these new business events in various places.
5. All the functionality still works as before, no functionality was removed.

Official Announcement - https://blogs.msdn.microsoft.com/nav/2018/09/12/new-system-events-replace-codeunit-1-in-business-central-october18-release/


Which functions become which events?

Codeunit 1 function nameNew Object TypeNew Object IDNew function name
CompanyOpenCodeunit40CompanyOpen
GetSystemIndicatorCodeunit40GetSystemIndicator
CompanyCloseCodeunit40CompanyClose
FindPrinterCodeunit44GetPrinterName
ApplicationVersionCodeunit9015ApplicationVersion
CustomApplicationVersionN/AN/AN/A
ReleaseVersionCodeunit9015ReleaseVersion
ApplicationBuildCodeunit9015ApplicationBuild
CustomApplicationBuildN/AN/AN/A
ApplicationLanguageCodeunit43ApplicationLanguage
DefaultRoleCenterCodeunit9170DefaultRoleCenterID
MakeDateTimeTextCodeunit41MakeDateTimeText
GetSeparateDateTimeCodeunit41GetSeparateDateTime
MakeDateTextCodeunit41MakeDateText
MakeTimeTextCodeunit41MakeTimeText
MakeTextCodeunit41MakeText
MakeDateTimeFilterCodeunit41MakeDateTimeFilter
MakeDateFilterCodeunit41MakeDateFilter
MakeTextFilterCodeunit41MakeTextFilter
MakeCodeFilterCodeunit41MakeTextFilter
MakeTimeFilterCodeunit41MakeTimeFilter
AutoFormatTranslateCodeunit45AutoFormatTranslate
ReadRoundingCodeunit45ReadRounding
CaptionClassTranslateCodeunit42CaptionClassTranslate
GetCueStyleCodeunit9701GetCueStyle
SetGlobalLanguageCodeunit43SetGlobalLanguage
ValidateApplicationlLanguageCodeunit43ValidateApplicationLanguage
LookupApplicationlLanguageCodeunit43LookupApplicationLanguage
GetGlobalTableTriggerMaskCodeunit49GetGlobalTableTriggerMask
OnGlobalInsertCodeunit49OnGlobalInsert
OnGlobalModifyCodeunit49OnGlobalModify
OnGlobalDeleteCodeunit49OnGlobalDelete
OnGlobalRenameCodeunit49OnGlobalRename
GetDatabaseTableTriggerSetupCodeunit49GetDatabaseTableTriggerSetup
OnDatabaseInsertCodeunit49OnDatabaseInsert
OnDatabaseModifyCodeunit49OnDatabaseModify
OnDatabaseDeleteCodeunit49OnDatabaseDelete
OnDatabaseRenameCodeunit49OnDatabaseRename
OnDebuggerBreakCodeunit9500ProcessOnDebuggerBreak
LaunchDebuggerCodeunit9500OpenDebugger
OpenSettingsCodeunit9170OpenSettings
OpenContactMSSalesCodeunit50OpenContactMSSales
InvokeExtensionInstallationCodeunit2501InvokeExtensionInstallation
CustomizeChartCodeunit9180CustomizeChart
HasCustomLayoutCodeunit44HasCustomLayout
MergeDocumentCodeunit44MergeDocument
ReportGetCustomRdlcCodeunit44ReportGetCustomRdlc
ReportSchedulerCodeunit44ScheduleReport
OnBeforeOpenSettingsCodeunit9170OnBeforeOpenSettings
OnAfterGetApplicationVersionCodeunit9015OnAfterGetApplicationVersion
OnBeforeCompanyOpenCodeunit40OnBeforeCompanyOpen
OnAfterCompanyOpenCodeunit40OnAfterCompanyOpen
OnRoleCenterOpenCodeunit9170OnRoleCenterOpen
OnBeforeCompanyCloseCodeunit40OnBeforeCompanyClose
OnAfterCompanyCloseCodeunit40OnAfterCompanyClose
OnAfterGetSystemIndicatorTable79OnAfterGetSystemIndicator
OnAfterFindPrinterCodeunit44OnAfterGetPrinterName
OnAfterGetDefaultRoleCenterCodeunit9170OnAfterGetDefaultRoleCenter
OnAfterMakeDateTextN/AN/AN/A
OnAfterMakeTimeTextN/AN/AN/A
OnAfterMakeTextN/AN/AN/A
OnAfterMakeDateTimeFilterCodeunit41OnAfterMakeDateTimeFilter
OnAfterMakeDateFilterCodeunit41OnAfterMakeDateFilter
OnAfterMakeTextFilterCodeunit41OnAfterMakeTextFilter
OnAfterMakeCodeFilterN/AN/AN/A
OnAfterMakeTimeFilterCodeunit41OnAfterMakeTimeFilter
OnAfterAutoFormatTranslateCodeunit45OnAfterAutoFormatTranslate
OnAfterCaptionClassTranslateCodeunit42OnAfterCaptionClassTranslate
OnAfterGetGlobalTableTriggerMaskCodeunit49OnAfterGetGlobalTableTriggerMask
OnAfterOnGlobalInsertCodeunit49OnAfterOnGlobalInsert
OnAfterOnGlobalModifyCodeunit49OnAfterOnGlobalModify
OnAfterOnGlobalDeleteCodeunit49OnAfterOnGlobalDelete
OnAfterOnGlobalRenameCodeunit49OnAfterOnGlobalRename
OnAfterGetDatabaseTableTriggerSetupCodeunit49OnAfterGetDatabaseTableTriggerSetup
OnAfterOnDatabaseInsertCodeunit49OnAfterOnDatabaseInsert
OnAfterOnDatabaseModifyCodeunit49OnAfterOnDatabaseModify
OnAfterOnDatabaseDeleteCodeunit49OnAfterOnDatabaseDelete
OnAfterOnDatabaseRenameCodeunit49OnAfterOnDatabaseRename
OnAfterHasCustomLayoutCodeunit44OnAfterHasCustomLayout
OnAfterReportGetCustomRdlcTable9650OnAfterReportGetCustomRdlc
OnBeforeOnDatabaseInsertCodeunit49OnBeforeOnDatabaseInsert
OnBeforeOnDatabaseModifyCodeunit49OnBeforeOnDatabaseModify
OnBeforeOnDatabaseDeleteCodeunit49OnBeforeOnDatabaseDelete
OnBeforeOnDatabaseRenameCodeunit49OnBeforeOnDatabaseRename
OnEditInExcelCodeunit6710OnEditInExcel
OnInstallAppPerDatabaseN/AN/AN/A
OnInstallAppPerCompanyN/AN/AN/A
OnCheckPreconditionsPerDatabaseCodeunit9900OnCheckPreconditionsPerDatabase
OnCheckPreconditionsPerCompanyCodeunit9900RaiseOnCheckPreconditionsPerCompany
OnUpgradePerDatabaseCodeunit9900OnUpgradePerDatabase
OnUpgradePerCompanyCodeunit9900OnUpgradePerCompany
OnValidateUpgradePerDatabaseCodeunit9900OnValidateUpgradePerDatabase
OnValidateUpgradePerCompanyCodeunit9900OnValidateUpgradePerCompany


Will try to come back at the same pace for blogging and will keep you updated. I have so much to share about the learnings that I had during the last 6-8 months.

Stay tuned.

Regards,
Saurav Dhyani
www.sauravdhyani.com

Comments

Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

BC 21 and Higher - PowerShell Cmdlet (Replacement of Business Central Administration).

Hi Readers, As discussed in last article about deprecating of Business Central Administration, there are few common actions that we use in administration till Business Central 20. For our on-prem customers, we will still require doing activities. As Microsoft suggest we need to start using PowerShell cmdlet.    Let's see how to do those via PowerShell, or Administration Shell. I will be keep adding commands as you comment to this article.

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing -