Muokkaa

Jaa


Data types and methods in AL

The following data types are available as part of the AL language. Each data type has various methods that support it. For more information about a data type and its methods, select a link in the table.

Type Description
Any This data type can be substituted by any other data type.
BigInteger Stores very large whole numbers that range from -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807.
BigText Handles large text documents.
Blob Is a complex data type. Variables of this data type differ from normal numeric and string variables in that BLOBs have a variable length. The maximum size of a BLOB(binary large object) is 2 GB.
Boolean Indicates true or false.
Byte Stores a single, 8-bit character as a value in the range 0 to 255. You can easily convert this data type from a number to a character and vice versa. This means you can use mathematical operators on Byte variables.
Char Stores a single, 16-bit character as a value in the range 0 to 65535. You can convert this data type from a number to a character and vice versa. This means you can use mathematical operators on Char variables.
Code Denotes a special type of string that is converted to uppercase and removes any trailing or leading spaces.
Codeunit Is a container for AL code that you can use from other application objects.
CompanyProperty Provides language support for company properties.
Cookie Provides a data structure to work with Http cookies.
Database Provides access to common database functionality.
DataTransfer A structure building bulk transfer of data between tables.
Date Denotes a date ranging from January 1, 1753 to December 31, 9999.
DateFormula Represents a date formula that has the same capabilities as an ordinary input string for the CALCDATE Method (Date). The DateFormula data type is used to provide multilanguage capabilities to the CALCDATE Method (Date).
DateTime Denotes a date and time ranging from January 1, 1753, 00:00:00.000 to December 31, 9999, 23:59:59.999. An undefined or blank DateTime is specified by 0DT.
Debugger Enables communication with a debugger.
Decimal Denotes decimal numbers ranging from -999,999,999,999,999.99 to +999,999,999,999,999.99.
Dialog Represents a dialog window.
Dictionary Represents an unordered collection of keys and values. The Dictionary data type is optimized for fast lookup of values.
DotNet Represents an unspecified .NET type.
Duration Represents the difference between two DateTimes. This value can be negative. It is stored as a 64-bit integer. The integer value is the number of milliseconds during the duration.
Enum Represents the text content of an element or attribute.
ErrorInfo Provides a structure for grouping information about an error.
FieldRef Identifies a field in a table and gives you access to this field.
File Represents a file.
FileUpload Represents a file.
FilterPageBuilder Stores filter configurations for a filter page. A filter page is a dynamic page type that contains one or more filter controls that enables users to set filters on fields of the underlying tables.
Guid Represents a 16 byte binary data type. This data type is used for the global identification of objects, programs, records, and so on. The important property of a GUID is that each value is globally unique. The value is generated by an algorithm, developed by Microsoft, which assures this uniqueness.
HttpClient Provides a data type for sending HTTP requests and receiving HTTP responses from a resource identified by a URI.
HttpContent Represents an HTTP entity body and content headers.
HttpHeaders Is a collection of headers and their values.
HttpRequestMessage Represents an HTTP request message.
HttpResponseMessage Represents an HTTP response message including the status code and data.
InStream Is a generic stream object that you can use to read from or write to files and BLOBs. You can define the internal structure of a stream as a flat stream of bytes. You can assign one stream to another. Reading from and writing to a stream occurs sequentially.
Integer Stores whole numbers with values that range from -2,147,483,647 to 2,147,483,647.
IsolatedStorage Provides data isolation for extensions.
JsonArray Is a container for any well-formed JSON array. A default JsonArray contains an empty JSON array.
JsonObject Is a container for any well-formed JSON object. A default JsonObject contains an empty JSON object.
JsonToken Is a container for any well-formed JSON data. A default JsonToken object contains the JSON value of NULL.
JsonValue Is a container for any well-formed fundamental JSON value. A default JsonValue is set to the JSON value of NULL.
KeyRef Identifies a key in a table and the fields in this key.
Label Denotes a string constant that can be optionally translated into multiple languages.
List Represents a strongly typed list of ordered objects that can be accessed by index. Contrary to the Array data type, a List is unbounded, such that its dimension does not need to be specified upon declaration.
Media Encapsulates media files, such as image .jpg and .png files, in application database tables. The Media data type can be used as a table field data type, but cannot be used as a variable or parameter. The Media data type enables you to import a media file to the application database and reference the file from records, making it possible to display the media file in the client user interface. You can also export media from the database to files and streams.
MediaSet Encapsulates media, such as images, in application database tables.
ModuleDependencyInfo Provides information about a dependent module.
ModuleInfo Represents information about an application consumable from AL.
NavApp Provides information about a NavApp.
None Is used implicitly when a method does not return a value.
Notification Provides a programmatic way to send non-intrusive information to the user interface (UI) in the Business Central Web client.
NumberSequence Is a complex data type for creating and managing number sequences in the database.
Option Denotes an option value. In the code snippet below, you can see how the Option data type is declared.
OutStream Is a generic stream object that you can use to write to files and BLOBs.
Page Contains a number of simpler elements called controls. Controls are used to display information to the user or receive information from the user.
ProductName An application can have a full name, marketing name, and short name. The PRODUCTNAME functions enable you to retrieve these name variations.
Query Enables you to retrieve data from multiple tables and combine the data in single dataset.
Record Is a complex data type.
RecordId Contains the table number and the primary key of a table.
RecordRef References a record in a table.
Report Is used to display, print, or process information from a database.
RequestPage Is a page that is run before the report starts to execute. Request pages enable end-users to specify options and filters for a report.
SecretText Denotes a secret text string, which is non-debuggable.
Session Represents a Microsoft Dynamics Business Central session.
SessionInformation Is a complex data type for exposing Session information into AL.
SessionSettings Is a complex data type for passing user personalization settings for a client session as an object. The object contains properties that correspond to the fields in the system table 2000000073 User Personalization, including: App ID, Company, Language ID, Locale ID, Profile ID, Scope, and Time Zone. You can use the AL methods of the SessionSettings data type to get, set, and send the user personalization settings for the current client session.
System Is a complex data type.
TaskScheduler TaskScheduler is a complex data type used for creating and managing tasks in the task scheduler, which runs codeunits at scheduled times.
TestAction Represents a test action on a page.
TestField Represents a testable field on a page.
TestFilter Represents a test filter on a page.
TestFilterField Represents the type of a field filter in a test filter on a page or on a request page.
TestPage Represents a variable type that can be used to test Page Application Objects.
TestPart Represents a variable type that can be used to test Page Application Objects of type Part.
TestRequestPage Stores test request pages. A test request page part is a logical representation of a request page on a report. A test request page does not display a user interface (UI). The subtype of a test request page is the report whose request page you want to test.
Text Denotes a text string.
TextBuilder Represents a lighweight wrapper for the .Net implementation of StringBuilder.
TextConst Denotes a multi-language string constant.
Time Denotes a time ranging from 00:00:00.000 to 23:59:59.999. An undefined or blank time is specified by 0T.
Variant Represents an AL variable object. The AL variant data type can contain many AL data types.
Version Represents a version matching the format: Major.Minor.Build.Revision .
WebServiceActionContext Represents an AL WebServiceActionContext.
XmlAttribute Represents an XML attribute.
XmlAttributeCollection Represents a collection of XML attributes.
XmlCData Represents a CData section.
XmlComment Represents an XML comment.
XmlDeclaration Represents an XML declaration.
XmlDocument Represents an XML document.
XmlDocumentType Represents an XML document type.
XmlElement Represents an XML element.
XmlNamespaceManager Represents a namespace manager that can be used to resolve, add and remove namespaces to a collection. It also provides scope management for these namespaces.
XmlNameTable Represents a table of atomized string objects.
XmlNode Represents a XML node which can either be for instance an XML attribute, an XML element or a XML document.
XmlNodeList Represents a collection of XML nodes.
Xmlport XmlPorts are used to export or import data between an external source and a Microsoft Dynamics Business Central database.
XmlProcessingInstruction Represents a processing instruction, which XML defines to keep processor-specific information in the text of the document.
XmlReadOptions Represents the options configuring how XML is loaded from a data source.
XmlText Represents the text content of an element or attribute.
XmlWriteOptions Represents the options configuring how XML is saved.
Action Represents the action that the user took on the page.
AuditCategory Represents an audit category for IfX audit telemetry.
ClientType Represents the type of the client executing the operation.
CommitBehavior Specifies whether commit is allowed within the scope of the method.
DataClassification Sets the classification of the data in the table or field.
DataScope Identifies the scope of stored data in the isolated storage.
DefaultLayout The default layout to be used by a report.
ErrorBehavior Specifies whether errors will be collected within the scope of the method.
ErrorType Represents the type of error.
ExecutionContext Represents the context in which a session is running. In certain scenarios, for example during upgrade, the system will run a session in a special context for a limited time.
ExecutionMode The execution mode of the current session.
FieldClass Represents the type of a field class.
FieldType Represents the type of a table field.
InherentPermissionsScope The different types of scope that the InherentPermissions attribute can apply to.
IsolationLevel The isolation level applied for this record.
NotificationScope Specifies the context in which the notification appears in the client.
ObjectType The different types of objects.
PageBackgroundTaskErrorLevel Specifies how an error in the page background task appears in the client.
PageStyle Represents the different kinds of styles that can be applied to page controls.
PermissionObjectType The different types of objects that can have different permissions assigned.
PromptMode Specifies the current mode of a PromptDialog page.
ReportFormat Specifies the format of the report.
ReportLayoutType Represents the type of a report layout.
SecurityFilter Specifies how security filters are applied to the record.
SecurityOperationResult Represents security audit operation result.
TableConnectionType Use variables of this data type to specify the type of connection to an external database.
TelemetryScope Represents the emission scope of the telemetry signal.
TestPermissions Specifies a value that can be used to determine which permission sets are used on tests that are run by test codunits or test functions.
TextEncoding Represents a file encoding.
TransactionModel Represents a test transaction model.
TransactionType Represents a transaction type.
Verbosity Represents the security level of events.
WebServiceActionResultCode Represents a web service action status code.

Get Started with AL
Developing Extensions