Business Central 2026 release wave 2 (BC29): Check records for uncommitted changes (Added the IsDirty property to the Record API)

Dynamics 365 Business Central

Hi, Readers.
The public preview for Dynamics 365 Business Central 2026 release wave 2 (BC29) is available. Learn more: Link.

I will continue to test and share some new features that I hope will be helpful. In this post, I would like to talk about Added the IsDirty property to the Record API.
Added the IsDirty property to the Record API:

Added the IsDirty property to the Record API.

https://marketplace.visualstudio.com/items/ms-dynamics-smb.al/changelog

Use the Record API IsDirty property to determine whether a record instance contains unsaved changes before deciding to validate, save, or otherwise process it.

procedure IsDirty(): Boolean
Gets a boolean value that indicates whether the current in-memory record instance has different values than when it was loaded from the database.

Below is a simple example. I modified the name of customer 10000 but have not committed the changes to the database yet. At this point, if you use IsDirty to perform the check, it will throw an error. Because the current in-memory record instance has different values than when it was loaded from the database.

So this allows developers to determine whether a record has been modified since it was retrieved or last persisted.

PS:

‘IsDirty’ is not available in runtime version ‘17.0’. The supported runtime versions are: ‘18.0’ or greater. AL AL0666

Great. Give it a try!!!😁

PS:
1. Business Central 2026 release wave 2 (BC29): Control transaction isolation for queries and isolated storage (Query ReadState supports ReadCommitted)

2. Business Central 2023 wave 1 (BC22) new features: Control database locking behavior (new ReadIsolation method)

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL