How to use Access modifiers in Dynamics 365 Business Central 2019 release wave 2

While going through the development stuff, i found an interesting topic which i thought of highlighting in this blog.

Access modifiers are a specific part of programming language syntax used to facilitate the encapsulation of components.

Access modifiers are keywords used to specify the accessibility of a class (or type) and its members. These modifiers can be used from code inside or outside the current application.

In Business Central 2019 release wave 2 release this property can be applied to

  • Tables and its fields
  • Codeunits
  • Queries
Access Modifier in Business Central 2019 release wave 2

For fields in the Table the Access modifier property can be as following

Internal The field can be accessed only by code in the same module, but not from another module.
Local The field can be accessed only by code in the same table or table extension where the field is defined.
Protected The field can be accessed only by code in the same table or tableextensions of that table.
Public The field can be accessed by any other code in the same module and in other modules that references it.
Field Access Modifier in Business Central 2019 release wave 2

For Object the Access Modifier property can be

Internal The object can be accessed only by code in the same module, but not from another module.
Public The object can be accessed by any other code in the same module and in other modules that references it. This is the default value.

You can procide access Modifier property to Procedures as well

Procedure Access Modifier in Business Central 2019 release wave 2

Stay tuned for my next blog on Business Central 2019 release wave 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s