Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Version: Available from runtime version 1.0.
Specifies the purpose of a codeunit.
Applies to
- Codeunits
Property value
| Value | Description |
|---|---|
Normal |
Defines a general-purpose codeunit. This value is the default. |
Test |
Defines a codeunit that contains test methods. |
TestRunner |
Defines a codeunit that runs one or more test codeunits. |
Upgrade |
Defines a codeunit that contains data-upgrade triggers. |
Install |
Defines a codeunit that contains extension-installation triggers. |
Syntax
SubType = Normal;
Remarks
Codeunits that have the SubType property set to Test or TestRunner support automated testing of your application.
A
Testcodeunit contains the test methods that test your application. When a test codeunit runs, it executes theOnRuntrigger, and then executes each test method in the codeunit. Unlike a normal codeunit, where a failing method terminates the codeunit, a test codeunit continues to run its remaining test methods even if one test method fails. Learn more in Test codeunits and test methods.A
TestRunnercodeunit manages the execution of one or more test codeunits and can integrate with external test management and reporting frameworks. It supports theOnBeforeTestRunandOnAfterTestRuntriggers, which run immediately before and after each test codeunit runs, so you can do preprocessing and postprocessing, such as initialization or logging test results. Learn more in Test runner codeunits.
An Upgrade codeunit contains the code that upgrades data from a previous extension version so that it's compatible with the current version. Upgrade codeunits support system triggers, such as OnUpgradePerCompany and OnUpgradePerDatabase, that run when you start the data upgrade process. Learn more in Upgrading extensions.
An Install codeunit contains code that runs operations, such as initializing data, when an extension is installed for the first time or reinstalled. Install codeunits support the OnInstallAppPerCompany and OnInstallAppPerDatabase triggers. Learn more in Writing extension install code.
Related information
Codeunit properties
Test codeunits and test methods
Test runner codeunits
Upgrade codeunits
Install codeunits
SubType property for BLOB fields