Quantcast
Channel: MSDN Blogs
Viewing all articles
Browse latest Browse all 35736

New system events replace Codeunit 1 in Business Central October’18 release

$
0
0

When you start upgrading to Business Central on-premises, you'll notice that Codeunit 1 ApplicationManagement is missing. Not to worry, this is not a ‘bug’, it is by design. We're refactoring the application as part of our move to modern development and to enable extensions to subscribe to events that were formerly handled by functions in codeunit 1.

The old ApplicationManagement codeunit has been retired, and new ‘system’ codeunits have been introduced in the 2 billion range.

These special codeunits are created by C/SIDE when a database is created so you will always have them, compiled, and ready to go. These new system codeunits do not contain code, all they contain are event publishers. Business Central Server will now call these event publishers instead of calling the respective functions in Codeunit 1 ApplicationManagement directly.

We have added subscribers to these new business events in various places in the application code to ensure all the functionality still works as before, no functionality was removed. Most of the real business logic was already moved out of the ApplicationManagement codeunit so these subscribers were added where the business logic really resides. The integration events were also moved from Codeunit 1 to their respective new homes.

You can find a detailed mapping of where each function moved in the table at the end of this blog post, and of course it will be part of the docs for the release of Business Central October'18. The list will be in the upgrade docs, so stay tuned for the update of the developer and ITPro docs!

The new ‘system’ codeunits are special in more ways than one. You will not be able to customize them as you would other codeunits. You also should not directly subscribe to the events in these codeunits either. While technically possible as of now, we will block this in the future which would be a breaking change for you. Instead you should subscribe to one of the integration events which now reside next to the business logic. The reason for this is to ensure the correct ordering of events and to provide before/after events where appropriate.

Of course this is a big change in how the server interacts with the application and you will need to adjust your customizations and extensions to this new way of working. You can find help and more information on how to do technical upgrade in the developer and ITPro docs for Business Central October'18 release.

Which functions become which events?

The following table describes the mapping from codeunit 1 to the new events:

Codeunit 1 function name New Object Type New Object ID New function name
CompanyOpen Codeunit 40 CompanyOpen
GetSystemIndicator Codeunit 40 GetSystemIndicator
CompanyClose Codeunit 40 CompanyClose
FindPrinter Codeunit 44 GetPrinterName
ApplicationVersion Codeunit 9015 ApplicationVersion
CustomApplicationVersion N/A N/A N/A
ReleaseVersion Codeunit 9015 ReleaseVersion
ApplicationBuild Codeunit 9015 ApplicationBuild
CustomApplicationBuild N/A N/A N/A
ApplicationLanguage Codeunit 43 ApplicationLanguage
DefaultRoleCenter Codeunit 9170 DefaultRoleCenterID
MakeDateTimeText Codeunit 41 MakeDateTimeText
GetSeparateDateTime Codeunit 41 GetSeparateDateTime
MakeDateText Codeunit 41 MakeDateText
MakeTimeText Codeunit 41 MakeTimeText
MakeText Codeunit 41 MakeText
MakeDateTimeFilter Codeunit 41 MakeDateTimeFilter
MakeDateFilter Codeunit 41 MakeDateFilter
MakeTextFilter Codeunit 41 MakeTextFilter
MakeCodeFilter Codeunit 41 MakeTextFilter
MakeTimeFilter Codeunit 41 MakeTimeFilter
AutoFormatTranslate Codeunit 45 AutoFormatTranslate
ReadRounding Codeunit 45 ReadRounding
CaptionClassTranslate Codeunit 42 CaptionClassTranslate
GetCueStyle Codeunit 9701 GetCueStyle
SetGlobalLanguage Codeunit 43 SetGlobalLanguage
ValidateApplicationlLanguage Codeunit 43 ValidateApplicationLanguage
LookupApplicationlLanguage Codeunit 43 LookupApplicationLanguage
GetGlobalTableTriggerMask Codeunit 49 GetGlobalTableTriggerMask
OnGlobalInsert Codeunit 49 OnGlobalInsert
OnGlobalModify Codeunit 49 OnGlobalModify
OnGlobalDelete Codeunit 49 OnGlobalDelete
OnGlobalRename Codeunit 49 OnGlobalRename
GetDatabaseTableTriggerSetup Codeunit 49 GetDatabaseTableTriggerSetup
OnDatabaseInsert Codeunit 49 OnDatabaseInsert
OnDatabaseModify Codeunit 49 OnDatabaseModify
OnDatabaseDelete Codeunit 49 OnDatabaseDelete
OnDatabaseRename Codeunit 49 OnDatabaseRename
OnDebuggerBreak Codeunit 9500 ProcessOnDebuggerBreak
LaunchDebugger Codeunit 9500 OpenDebugger
OpenSettings Codeunit 9170 OpenSettings
OpenContactMSSales Codeunit 50 OpenContactMSSales
InvokeExtensionInstallation Codeunit 2501 InvokeExtensionInstallation
CustomizeChart Codeunit 9180 CustomizeChart
HasCustomLayout Codeunit 44 HasCustomLayout
MergeDocument Codeunit 44 MergeDocument
ReportGetCustomRdlc Codeunit 44 ReportGetCustomRdlc
ReportScheduler Codeunit 44 ScheduleReport
OnBeforeOpenSettings Codeunit 9170 OnBeforeOpenSettings
OnAfterGetApplicationVersion Codeunit 9015 OnAfterGetApplicationVersion
OnBeforeCompanyOpen Codeunit 40 OnBeforeCompanyOpen
OnAfterCompanyOpen Codeunit 40 OnAfterCompanyOpen
OnRoleCenterOpen Codeunit 9170 OnRoleCenterOpen
OnBeforeCompanyClose Codeunit 40 OnBeforeCompanyClose
OnAfterCompanyClose Codeunit 40 OnAfterCompanyClose
OnAfterGetSystemIndicator Table 79 OnAfterGetSystemIndicator
OnAfterFindPrinter Codeunit 44 OnAfterGetPrinterName
OnAfterGetDefaultRoleCenter Codeunit 9170 OnAfterGetDefaultRoleCenter
OnAfterMakeDateText N/A N/A N/A
OnAfterMakeTimeText N/A N/A N/A
OnAfterMakeText N/A N/A N/A
OnAfterMakeDateTimeFilter Codeunit 41 OnAfterMakeDateTimeFilter
OnAfterMakeDateFilter Codeunit 41 OnAfterMakeDateFilter
OnAfterMakeTextFilter Codeunit 41 OnAfterMakeTextFilter
OnAfterMakeCodeFilter N/A N/A N/A
OnAfterMakeTimeFilter Codeunit 41 OnAfterMakeTimeFilter
OnAfterAutoFormatTranslate Codeunit 45 OnAfterAutoFormatTranslate
OnAfterCaptionClassTranslate Codeunit 42 OnAfterCaptionClassTranslate
OnAfterGetGlobalTableTriggerMask Codeunit 49 OnAfterGetGlobalTableTriggerMask
OnAfterOnGlobalInsert Codeunit 49 OnAfterOnGlobalInsert
OnAfterOnGlobalModify Codeunit 49 OnAfterOnGlobalModify
OnAfterOnGlobalDelete Codeunit 49 OnAfterOnGlobalDelete
OnAfterOnGlobalRename Codeunit 49 OnAfterOnGlobalRename
OnAfterGetDatabaseTableTriggerSetup Codeunit 49 OnAfterGetDatabaseTableTriggerSetup
OnAfterOnDatabaseInsert Codeunit 49 OnAfterOnDatabaseInsert
OnAfterOnDatabaseModify Codeunit 49 OnAfterOnDatabaseModify
OnAfterOnDatabaseDelete Codeunit 49 OnAfterOnDatabaseDelete
OnAfterOnDatabaseRename Codeunit 49 OnAfterOnDatabaseRename
OnAfterHasCustomLayout Codeunit 44 OnAfterHasCustomLayout
OnAfterReportGetCustomRdlc Table 9650 OnAfterReportGetCustomRdlc
OnBeforeOnDatabaseInsert Codeunit 49 OnBeforeOnDatabaseInsert
OnBeforeOnDatabaseModify Codeunit 49 OnBeforeOnDatabaseModify
OnBeforeOnDatabaseDelete Codeunit 49 OnBeforeOnDatabaseDelete
OnBeforeOnDatabaseRename Codeunit 49 OnBeforeOnDatabaseRename
OnEditInExcel Codeunit 6710 OnEditInExcel
OnInstallAppPerDatabase N/A N/A N/A
OnInstallAppPerCompany N/A N/A N/A
OnCheckPreconditionsPerDatabase Codeunit 9900 OnCheckPreconditionsPerDatabase
OnCheckPreconditionsPerCompany Codeunit 9900 RaiseOnCheckPreconditionsPerCompany
OnUpgradePerDatabase Codeunit 9900 OnUpgradePerDatabase
OnUpgradePerCompany Codeunit 9900 OnUpgradePerCompany
OnValidateUpgradePerDatabase Codeunit 9900 OnValidateUpgradePerDatabase
OnValidateUpgradePerCompany Codeunit 9900 OnValidateUpgradePerCompany

 


Viewing all articles
Browse latest Browse all 35736


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>