Business Central 2022 wave 2 (BC21) new features: Exclude temporary records when debugging record writes (“breakOnRecordWrite”:”ExcludeTemporary”)

Dynamics 365 Business Central

Hi, Readers.
The preview environment for Dynamics 365 Business Central 2022 release wave 2 (BC21) is available. Learn more: Link.

I will continue to test and share some new features that I hope will be helpful.

Exclude temporary records when debugging record writes:

Business value:

When debugging, it has been possible to control whether to break on record writes. However, until now, any writes to temporary records have also triggered a break. To allow ignoring these for a more efficient debugging of database writes, a new option has been added to omit any writes to temporary records.

This new feature is similar to Exclude Try functions when debugging errors (“breakOnError”: “ExcludeTry”) feature.

Microsoft have added new options to control when the debugger should break on record writes. Instead of the old Boolean BreakOnRecordWrite setting in a launch.json file connection setup, this now takes one of the following values: truefalseNoneAllExcludeTemporary.

The behavior for each option is:

  • false/None: Does not break on any record writes.
  • true/All: Breaks on all record writes.
  • ExcludeTemporary: Breaks on record writes only if they are not on a temporary table.

True and false are retained for now for backward compatibility. They map to All and None. We recommend using the latter going forward. True and false might become obsolete in a future version.

PS: As of now (2022/09/06), Microsoft has not updated MS Docs. More details: Launch.json file

breakOnRecordWriteNoSpecifies if the debugger breaks on record changes. The default value is false.

Let’s look at a simple example.

I added a new action to Customer List to do delete and insert operations on a temporary table. More details about: Promoted action groups, action references, and ShowAs Property (New Modern Action Bar)

If I set “breakOnRecordWrite”:”All” in launch.json file.

The debugger breaks on the temporary record changes.

If I set “breakOnRecordWrite”:”ExcludeTemporary” in launch.json file. The debugger ignores changes to temporary records.

Test Video: When using the standard features in Business Central, there may be a lot of temporary records being changed, which makes debugging difficult, but when “breakOnRecordWrite”:”ExcludeTemporary” is set, there are significantly fewer steps.

Give it a try!!!😁


Hope this will help.

Thanks for reading.