Freigeben über


Changes in C/AL Behavior and Support from Earlier Versions of Microsoft Dynamics NAV

Applies to: Microsoft Dynamics NAV 2017. See Microsoft Dynamics NAV 2018 version.

The following tables provide an overview of the new, removed, or changed C/AL data types, functions, properties, and triggers in Microsoft Dynamics NAV 2018 since the previous version of Dynamics NAV. For more information about the changes, see the specific topic about the data type, function, property, or trigger.

C/AL Data Types

The following table lists the new data types in Microsoft Dynamics NAV 2018.

Data Type Description
Media A complex type that encapsulates media (such as images) in the application database for displaying the media with associated records. The data type can be used on table fields and supports the following functions:

- ImportFile
- ImportInStream
- MEDIAID
- HASVALUE
- EXPORTFILE
- EXPORTSTREAM

MediaSet A complex type that encapsulates media files, such as images, in application database for displaying the media with associated records. The MediaSet data type enables you to include multiple media files as part of a collection on a record. The MediaSet data type can be used on table fields and supports the following functions:

- ImportFile
- ImportInStream
- MEDIAID
- COUNT
- EXPORTMEDIASET

Notification A complex type for publishing and consuming notifications in the application. Notifications provide a programmatic way to send non-intrusive information to the user interface (UI). The Notification data type supports the following functions:

- ADDACTION
- GETDATA
- ID
- MESSAGE
- RECALL
- SCOPE
- SEND
- SETDATA

See the C/AL Functions section that follows for a description of the data type functions.

C/AL Functions

New functions

The following table lists the new functions in Microsoft Dynamics NAV 2018.

Function Description
ADDACTION Function (Notification) Specifies an action for the notification.
GETDATA Function (Notification) Retrieves data that was passed to a notification instance as specified by a SETDATA function call.
ID Function (Notification) Specifies the identifier for a notification.
MESSAGE Function (Notification) Specifies the content of the notification.
RECALL Function (Notification) Recall a sent notification.
SCOPE Function (Notification) Specifies the context in which the notification appears in the client.
SEND Function (Notification) Sends the notification to the client, where it will display in the UI.
SETDATA Function (Notification) Specifies a data property value for the notification. The data is specified as text in a key-value pair.
APPLICATIONAREA Function Gets or sets the application areas for the current session.
CAPTIONCLASSTRANSLATE Function Returns a translated version of the caption string. The string is translated to the current local language.
CHANGECOMPANY Function (RecordRef) Redirects references to table data from one company to another.
COUNT Function (MediaSet) Gets the number of media files that are included in a media set of a record.
EXPORTFILE Function (Media) Exports a media object that is set up on a record to a file.
EXPORTFILE Function Exports the media objects that included in a media set to individual files.
EXPORTSTREAM Function (Media) Exports a media object that is set up on a record to an OutStream object.
HASVALUE Function (Media) Detects whether a record has a media object in the Media data type field.
IMPORTFILE Function (Media) Adds media from a file to a media set of a record.
IMPORTFILE Function (MediaSet) Adds media from a file to a media set of a record.
IMPORTSTREAM Function (Media) Adds media from an InStream object to a record.
IMPORTSTREAM Function (MediaSet) Adds media from an InStream object to a media set of a record.
ISBYTE Function (Variant) Indicates whether a C/AL variant contains a Byte variable.
ISTEXTCONSTANT Function (Variant) Indicates whether a C/AL variant contains a text constant.
MEDIAID Function (Media) Get the ID that is assigned to media in the database.
MEDIAID Function (MediaSet) Gets the ID that is assigned to the media set of a record.
PRODUCTNAME Functions Get the name of the application in three variations: full, marketing, and short.

Changed functions

The following table lists the changed functions in Microsoft Dynamics NAV 2018.

Function Description
TryFunction By default, database write transactions in a try function are not allowed. For more information, see Database write transactions in try functions.

C/AL Properties

The following table lists the new properties in Microsoft Dynamics NAV 2018.

Property Description
ApplicationArea Property Sets the application areas that apply to the control.
Gesture Property Specifies a gesture that runs the page action on a device with a touch interface.
TestPermissions Property 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.
PromotedOnly Property Specifies whether a page action will appear only on the Home tab in the ribbon and not on the tab where it is defined.

C/AL Triggers

The following table lists the changed triggers in Microsoft Dynamics NAV 2018.

Trigger Description
OnAfterTestRun Trigger Includes a TestPermissions data type parameter for running tests with permission sets.
OnBeforeTestRun Trigger Includes a TestPermissions data type parameter for running tests with permission sets.

See Also

Functions Not Supported by Microsoft Dynamics NAV Web Client
Page Properties Not Supported by Microsoft Dynamics NAV Web Client