System Data Type

Version: Available or changed with runtime version 1.0.

Is a complex data type.

Static methods

The following methods are available on the System data type.

Method name Description
Abs(Decimal) Calculates the absolute value of a number (Decimal, Integer or BigInteger). ABS always returns a positive numeric value or zero.
ApplicationPath() Returns the path of the directory where the executable file for the product is installed.
ArrayLen(Array of [Any] [, Integer]) Returns the total number of elements in an array or the number of elements in a specific dimension.
CalcDate(Text [, Date]) Calculates a new date that is based on a date expression and a reference date.
CalcDate(DateFormula [, Date]) Calculates a new date that is based on a date expression and a reference date.
CanLoadType(DotNet) Tests if the specified .NET Framework type can be loaded.
CaptionClassTranslate(Text) Returns a translated version of the caption string. The string is translated to the current local language.
Clear(var Array of [Any]) Clears the value of a single variable. Also, it clears all the filters that were set if the variable is a record and resets the key to the primary key and the company on a record variable.
Clear(var Any) Clears the value of a single variable. Also, it clears all the filters that were set if the variable is a record and resets the key to the primary key and the company on a record variable.
Clear(var SecretText) Clears the value of a single variable.
ClearAll() Clears all internal variables (except REC variables), keys, and filters in the object and in any associated objects, such as reports, pages, codeunits, and so on that contain AL code.
ClearCollectedErrors() Clears all collected errors from the current collection scope.
ClearLastError() Removes the last error message from memory.
ClosingDate(Date) Gets the closing date for a Date Data Type.
CodeCoverageInclude(var Record) Includes the code that has been logged.
CodeCoverageLoad() Loads the code that has been logged.
CodeCoverageLog([Boolean] [, Boolean]) Starts and stops the logging of code. You can also use this method to retrieve the current logging status.
CodeCoverageRefresh() Refreshes the code that has been logged.
CompressArray(Array of [Text]) Moves all non-empty strings (text) in an array to the beginning of the array. The resulting StringArray has the same number of elements as the input array, but empty entries appear at the end of the array.
CopyArray(Array of [Any], Array of [Any], Integer [, Integer]) Copies one or more elements in an array to a new array.
CopyStream(OutStream, InStream [, Integer]) Copies the information that is contained in an InStream to an OutStream.
CreateDateTime(Date, Time) Creates a DateTime object from a date and a time.
CreateEncryptionKey() Creates an encryption key for the current tenant.
CreateGuid() 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.
CurrentDateTime() Gets the current DateTime.
Date2DMY(Date, Integer) Gets the day, month, or year of a Date Data Type.
Date2DWY(Date, Integer) Gets the day of the week, week number, or year of a Date Data Type.
DaTi2Variant(Date, Time) Creates a variant that contains an encapsulation of a COM VT\_DATE.
Decrypt(Text) Takes a string as input and returns the decrypted value of the string.
DeleteEncryptionKey() Deletes an encryption key for the current tenant.
DMY2Date(Integer [, Integer] [, Integer]) Gets a Date object based on a day, month, and year.
DT2Date(DateTime) Gets the date part of a DateTime object.
DT2Time(DateTime) Gets the time part of a DateTime object.
DWY2Date(Integer [, Integer] [, Integer]) Gets a Date that is based on a week day, a week, and a year.
Encrypt(Text) Takes a string as input and returns the encrypted value of the string.
EncryptionEnabled() Checks if the tenant is configured to allow encryption.
EncryptionKeyExists() Checks whether an encryption key for the current tenant is present on the server tenant.
Evaluate(var Any, Text [, Integer]) Evaluates a string representation of a value into its typical representation. The result is assigned to a variable.
ExportEncryptionKey(Text) Returns a password protected temporary filepath containing the encryption key. When encrypting or decrypting data in Dynamics 365 Business Central, an encryption key is used. A single key is used per tenant and every tenant will have a different key. Keys can be exported to a file which may be necessary in the case of upgrading or migrating a system from one set of hardware to another. The EXPORTENCRYPTIONKEY method allows an administrator to specify a destination file for the key and specify a password protection for the file.
ExportObjects(Text, var Record [, Integer]) Exports application objects to a file.
Format(Any [, Integer] [, Integer]) Formats a value into a string.
Format(Any, Integer, Text) Formats a value into a string.
GetCollectedErrors([Boolean]) Gets all collected errors in the current collection scope.
GetDocumentUrl(Guid) Gets the URL for the specified temporary media object ID.
GetDotNetType(Any) Gets the System.Type that corresponds to the given value.
GetLastErrorCallStack() Gets the call stack from where the last error occurred.
GetLastErrorCode() Gets the classification of the last error that occurred.
GetLastErrorObject() Gets the last System.Exception object that occurred.
GetLastErrorText() Gets the last error that occurred in the debugger.
GetLastErrorText(Boolean) Gets the last error that occurred in the debugger.
GetUrl(ClientType [, Text] [, ObjectType] [, Integer] [, Record] [, Boolean]) Generates a URL for the specified client target that is based on the configuration of the server instance. If the code runs in a multitenant deployment architecture, the generated URL will automatically apply to the tenant ID of the current user.
GetUrl(ClientType, Text, ObjectType, Integer, RecordRef [, Boolean]) Generates a URL for the specified client target that is based on the configuration of the server instance. If the code runs in a multitenant deployment architecture, the generated URL will automatically apply to the tenant ID of the current user.
GlobalLanguage([Integer]) Gets and sets the current global language setting.
GuiAllowed() Checks whether the AL code can show any information on the screen.
HasCollectedErrors() Gets a value indicating whether errors have been collected in the current error collection scope.
Hyperlink(Text) Passes a URL as an argument to an Internet browser, such as Windows Internet Explorer.
ImportEncryptionKey(Text, Text) Points to a password protected file that contains the key on the current server. When encrypting or decrypting data in Dynamics 365 Business Central, an encryption key is used. A single key is used per tenant, and every tenant will have a different key. Keys can be created or imported if one exists already, as may be the case if upgrading or migrating a system from one set of hardware to another. The IMPORTENCRYPTIONKEY method allows an administrator to specify a file (password protected) which contains a key and imports it to the current Dynamics 365 Business Central service.
ImportObjects(Text [, Integer]) Imports application objects from a file.
ImportStreamWithUrlAccess(InStream, Text [, Integer]) Imports an object into a media container to be used in a temporary URL with a default expiration time.
IsCollectingErrors() Gets a value indicating whether errors are currently being collected.
IsNull(DotNet) Gets a value indicating whether a DotNet object has been created or not.
IsNullGuid(Guid) Indicates whether a value has been assigned to a GUID. A null GUID that consists only of zeros is valid but must never be used for references.
IsServiceTier() Gets a value indicating whether the runtime is a service tier.
NormalDate(Date) Gets the regular date (instead of the closing date) for the argument Date.
Power(Decimal, Decimal) Raises a number to a power. For example, you can use this method to square the number 2 to get the result of 4.
Random(Integer) Returns a pseudo-random number.
Randomize([Integer]) Generates a set of random numbers from which the RANDOM method (Integer) will select a random number.
Round(Decimal [, Decimal] [, Text]) Rounds the value of a numeric variable.
RoundDateTime(DateTime [, BigInteger] [, Text]) Rounds a DateTime.
Sleep(Integer) Returns control to the operating system for a specified time.
TemporaryPath() Gets the path of the directory where the temporary file is stored.
Time() Gets the current time from the operating system.
Today() Gets the current date set in the operating system.
Variant2Date(Variant) Gets a date from a variant.
Variant2Time(Variant) Gets a time from a variant.
WindowsLanguage() Gets the current Windows language setting.
WorkDate([Date]) Gets and sets the work date for the current session.

See Also

Get Started with AL
Developing Extensions