Hi, Readers.
Dynamics 365 Business Central 2025 wave 2 (BC27) is generally available. More details: General Available: Dynamics 365 Business Central 2025 release wave 2 (BC27).
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 how to create a new sequential unique GUID (Guid.CreateSequentialGuid Method).
This new feature is not yet documented in the Business Central 2025 release wave 2 (BC27) release plan but is mentioned in AL Language extension changelog Version 16.0.
Add
Changelog | Visual Studio MarketplaceGuid.CreateGuid(same asCreateGuid) andGuid.CreateSequentialGuidwhich creates a new unique GUID which is more performant when used in a table key.


Let’s see more details.
Guid.CreateGuid() Method: Creates a new unique GUID. The value can then be assigned to a GUID data type or a text data type. Use the text data type if you want to compare the GUID to another text string.

Guid.CreateSequentialGuid() Method: Creates a new sequential unique GUID. Sequential GUIDs perform better when used as a field in a key, because they are partially sequential instead of fully random.

Let’s look at a simple example that generates a Guid five times in a row.

First:

Second:

Third:

Fourth:

Fifth:

We can see that the Guids generated using Guid.CreateSequentialGuid() Method are sequential.
Test video:
But note that this is only for a single execution, the second execution will start from a new GUID.
Great, give it a try!!!😁
END
Hope this will help.
Thanks for reading.
ZHU




コメント