Dynamics 365 Business Central: How to quickly get the id from Guid without brackets

Dynamics 365 Business Central

Hi, Readers.
Today I would like to share another mini tip about Business Central, how to quickly get the id from Guid without brackets in AL.
As you know, there are many Guid Data type fields in Business Central. The GUID is a 16-byte binary data type that can be logically grouped into the following subgroups:
4byte-2byte-2byte-2byte-6byte.
The important property of a GUID is that each value is globally unique. More details: Guid Data type
For example, the following system fields, SystemId and SystemCreatedBy:

The standard textual representation is {aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb}.

Another example,

So is there any easy way to remove the brackets? Yes, there is a standard method in codeunit 5465 “Graph Mgt – General Tools” that can be used.

procedure GetIdWithoutBrackets: You can also refer to the standard method to write your own method, which is not difficult.

So just do this below to solve the problem.

Very simple, give it a try!!!😁

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL