Dynamics 365 Business Central 2022 Wave 2 – Access database row version from AL code

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2022 Wave 2 has several exciting Development features for runtime 10.0. One of the exciting features is to Access database row version from AL code.

Dynamics 365 Business Central 2020 Wave 2 introduced data audit system fields to every table. The audit fields, SystemLastModifiedOn, SystemLastModifiedBy, SystemCreatedBy, and SystemCreatedOn are populated by the platform when a record is created or modified.

With the release of Dynamics 365 Business Central 2022 Wave 2, a global row version number was added to all tables. The platform updates the SystemRowVersion value each time a record is updated. Developers can access this value to query for updated data.

In this example, the SystemRowVersion is displayed on the Customer List Page. When viewing the Customer List Page we can see the values of the audit fields and the version value for the records.

When the Customer is modified, the SystemRowVersion is updated:

Read more about the feature Access database row version from AL code here.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 2 online.

Permanent link to this article: https://www.dvlprlife.com/2022/10/access-database-row-version-from-al-code/

Dynamics 365 Business Central 2022 Wave 2 – Exclude Try functions when debugging errors

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2022 Wave 2 has several exciting Development features for runtime 10.0. One of the exciting features is to Exclude Try functions when debugging errors.

Before Microsoft Dynamics 365 Business Central 2022 Wave 2, when debugging code, developers could determine if the debugger would break on errors by setting the key, BreakOnError, in the launch.json file value to true or false. When debugging code that uses Try functions, this often leads to many unnecessary breaks because, usually, Try functions are designed to cause errors. With the release of Microsoft Dynamics 365 Business Central, developers have new options for the value of the BreakOnError key.

Then options are:
None (false): do not break on errors
All (true): break on all errors
ExcludeTry: break on all errors if they occur outside of the context of a try function

When debugging the following code with the BreakOnError key value set to All, the debugger will break on the error generated within the Try function. If the BreakOnError key is set to ExcludeTry, the debugger will not break on the error within the Try function.

Note: the true and false options are used for backwards compatibility and may become obsolete in the future. It is recommended to use the All and None option values.

Read more about the feature Exclude Try functions when debugging errors here.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 2 online.

Permanent link to this article: https://www.dvlprlife.com/2022/10/exclude-try-functions-when-debugging-errors/

October 2022 Cumulative Updates for Dynamics 365 Business Central and Microsoft Dynamics NAV

The October updates for Microsoft Dynamics NAV and Microsoft Dynamics 365 Business Central are now available.

Before applying the updates, you should confirm that your implementation is ready for the upgrade and ensure compatibility with your modifications. Work with a Microsoft Partner to determine if you are ready and what is needed for you to apply the update.

Please note that SaaS customers will automatically be upgraded to Microsoft Dynamics 365 Business Central 2022 Wave 2 (Version 21) over the coming days/weeks and should receive an email notification when upgraded.

Direct links to the cumulative updates are listed here:

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.6 (October 2022)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.12 (October 2022)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.18 (October 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 2 Updates – Update 17.17 (April 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 1 Updates – Update 16.19 (January 2022)

Dynamics 365 Business Central On-Premises 2019 Release Wave 2 Updates – Update 15.17 (April 2021)

Dynamics 365 Business Central On-Premises Spring 2019 Updates – Update 40 (October 2022)

Dynamics 365 Business Central On-Premises October’18 Updates – Update 18 (April 2020)

Microsoft Dynamics NAV 2018 – Update 57 (October 2022)

Microsoft Dynamics NAV 2017 – Update Update 61 (January 2022)

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

Permanent link to this article: https://www.dvlprlife.com/2022/10/october-2022-cumulative-updates-for-dynamics-365-business-central-and-microsoft-dynamics-nav/

Dynamics 365 Business Central 2022 Wave 2 – Enable NoImplicitWith feature by default

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2022 Wave 2 has several exciting Development features for runtime 10.0. One of the exciting features is to Dynamics 365 Business Central 2022 Wave 2 – Enable NoImplicitWith feature by default.

Microsoft Dynamics 365 Business Central 2020 Wave 2 added the Obsolete implicit and explicit use of ‘with’ development feature. The implicit or explicit ‘with’ use introduces possible collisions when referencing only member names instead of the fully qualified name.

From Business Central 2020 Wave 2 forward, the use of implicit and explicit ‘with’ was managed by Compiler Warning AL0606 and AL0604.

Developers could suppress the warning by using the suppressWarnings property in the app.json file, the pragma compiler directive, or a Ruleset rule. The implicit and explicit use of ‘with’ can be switched on or off with the NoImplicitWith option in the features property in the app.json file. Beginning with Business Central 2022 Wave 2, the NoImplicitWith option is enabled by default with the AL:Go! template.

Read more about the feature Enable NoImplicitWith feature by default here.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 2 online.

Permanent link to this article: https://www.dvlprlife.com/2022/10/enable-noimplicitwith-feature-by-default/

It’s Friday – September 30

Permanent link to this article: https://www.dvlprlife.com/2022/09/its-friday-september-30/

Dynamics 365 Business Central 2022 Wave 2 – See the primary key for table fields in IntelliSense

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2022 Wave 2 has several exciting Development features for runtime 10.0. One of the exciting features is to See the primary key for table fields in IntelliSense.


When developing AL Extensions within VS Code, it is often necessary to work with table fields. In many cases, such as record navigation or creation, knowing the primary keys for a table is important. Before the Microsoft Dynamics 365 Business Central 2022 Wave 2, developers navigated back to the source table to see the primary fields and their sequence. With the release of Microsoft Dynamics 365 Business Central 2022 Wave 2, a table’s primary key fields are identifiable along with their sequence.

 

Read more about the feature See the primary key for table fields in IntelliSense here.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central Public Preview 2022 Wave 2 online.

Permanent link to this article: https://www.dvlprlife.com/2022/09/see-the-primary-key-for-table-fields-in-intellisense/

It’s Friday – September 23

Permanent link to this article: https://www.dvlprlife.com/2022/09/its-friday-september-23/

Dynamics 365 Business Central 2022 Wave 2 – Use option access syntax in formulas

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2022 Wave 2 has several exciting Development features for runtime 10.0. One of the exciting features is to Use option access syntax in formulas.

AL Development in Microsoft Dynamics 365 Business Central allows option access syntax for referencing objects throughout the language. Object option access simplifies the reference and readability of code when an ObjectID value is required.

For example, the syntax of the EventSubscriber attribute is
 
[EventSubscriber(ObjectType: ObjectType, ObjectId: Integer, EventName: Text, ElementName: Text, SkipOnMissingLicense: Boolean, SkipOnMissingPermission: Boolean)]
When writing code in AL, you can use either the object number or option access syntax for the object in the ObjectID parameter. I have always wondered why this option has not been possible in formulas property values.
[EventSubscriber(ObjectType::Codeunit, 12, 'OnAfterInitVendLedgEntry', '', true, true)]
or 
 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnAfterInitVendLedgEntry', '', true, true)]

It is much easier on the eyes.

Dynamics 365 Business Central 2022 Wave 2 adds the option to use option access syntax in formulas. Before we had to write

and now we can write

Read more about the feature Use option access syntax in formulas here.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central Public Preview 2022 Wave 2 online.

Permanent link to this article: https://www.dvlprlife.com/2022/09/use-option-access-syntax-in-formulas/

Dynamics 365 Business Central 2022 Wave 2 – Exclude temporary records when debugging record writes

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2022 Wave 2 has several exciting Development features. One of the exciting features is to Exclude temporary records when debugging record writes.

While debugging in Microsoft Dynamics 365 Business Central, it is often desirable to break on record writes. The BreakOnRecordWrite setting in the Launch configuration determines if the debugger will break on record writes. Setting the BreakOnRecordWrite to true would trigger a break on record writes while debugging.

With the release of Dynamics 365 Business Central Wave 2, a new option – ExcludeTemporary, was added to the BreakOnRecordWrite setting. The BreakOnRecordWrite setting options are:

None (false): Do not break on any record writes.
All (true): Break on all record writes.
ExcludeTemporary: Breaks on record writes for non-temporary tables

Note: the true and false options are available for backward compatibility and may become obsolete. True/False values should be changed to the appropriate new option value.

Read more about the feature Exclude temporary records when debugging record writes here.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central Public Preview 2022 Wave 2 online.

Permanent link to this article: https://www.dvlprlife.com/2022/09/exclude-temporary-records-when-debugging-record-writes/

It’s Friday – September 16

Permanent link to this article: https://www.dvlprlife.com/2022/09/its-friday-september-16/