Dynamics 365 Business Central: How to insert a record with a specified SystemId in AL
The post explains how to insert a record with a specified SystemId in AL using the Insert(Boolean, Boolean) method instead of the default Insert() method. It covers what SystemId is, its characteristics, and how to use the InsertWithSystemId parameter to assign a custom GUID value when creating records.

post Dynamics 365 Lab
"The SystemId field is a GUID data type field that specifies a unique, immutable (read-only) identifier for records in the table."
Key points
- SystemId is a read-only GUID field that uniquely identifies records and is automatically assigned by the platform unless explicitly set during insert
- Use Insert(Boolean, Boolean) with the InsertWithSystemId parameter set to true to assign a custom SystemId value instead of letting the platform auto-generate it
- Once a SystemId is assigned to a record, it cannot be changed
- SystemId has field number 2000000000 and can be used as a binding key for APIs
Quotes
- “The SystemId field is a GUID data type field that specifies a unique, immutable (read-only) identifier for records in the table.” (Defines what SystemId is and its core purpose in the system)
- “You can assign your own value when a record is inserted in the database. Otherwise, the platform will automatically generate and assign a value.” (Explains the key choice developers have between manual and automatic SystemId assignment)
- “After the SystemId is set on a record, it can’t be changed.” (Critical immutability constraint that affects how developers must handle SystemId values)
Heads up
- warning: “After the SystemId is set on a record, it can’t be changed.”
Context
- Features: SystemId field, Record.Insert() method, Insert(Boolean, Boolean) method, GUID binding for APIs, Record unique identifier
- Versions: Business Central 2019 release wave 2 and later
Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.