Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Version: Available or changed with runtime version 1.0.
Sets whether a single instance of the codeunit and codeunit variables are instantiated.
True if only one instance of a codeunit that makes it a single instance codeunit is set; otherwise, false. The default is false.
SingleInstance = true;
When you set this property to true on a codeunit, all codeunit variables that use this codeunit use the same instance. That is, all codeunit variables of this codeunit use the same set of internal variables when the code is running on the same client. The codeunit remains instantiated until you close the company.
The following example shows how you can use the SingleInstance property.
Two pages can connect to the same codeunit.
On Page1:
Codeunit1.SetNumber(100);
On Page2:
Number := Codeunit1.GetNumber();
Message(Format(Number));
The SingleInstance property in Codeunit1 is set to true. Page1 calls a function on Codeunit1 and sets the parameter to 100. Codeunit1 saves this parameter in a local variable. Page2 is now able to get the parameter value (=100) from Codeunit1. A message is displayed.
Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register today