When you want to use objects from the .NET Framework in C/AL code, one of the main challenges is to handle exceptions that the methods of these objects may throw. Eventually, if not handled, they will basically bubble up as runtime errors, halting the current operation a user is doing without having a chance to properly display errors in a user-friendly format.
For more details check following links :
https://blogs.msdn.microsoft.com/nav/2015/10/28/nav-design-pattern-tryfunction-net-exception-handling-in-cal/
You can refer my earlier post too using below link :
https://msdynamicsnavashwinitripathi.wordpress.com/2015/10/15/using-try-functions-in-navision-2016/
Showing posts with label Functions. Show all posts
Showing posts with label Functions. Show all posts
Wednesday, 28 October 2015
Tuesday, 6 October 2015
Changes in C/AL Behaviour C/AL Functions in Nav 2016
The following table lists the summary of new, removed, or changed functions in Microsoft Dynamics NAV 2016.
Will come with more details in my later posts.
Will come with more details in my later posts.
| Function | Description |
| ADDFIELD Function | New function. Adds a table field to the filter control for a table on filter page. |
| ADDFIELDNO Function | New function. Adds a table field to the filter control for a table as specified by the field number. |
| ADDRECORD Function | New function. Adds a filter control for a table to a filter page as specified by a record data type variable. |
| ADDRECORDREF Function | New function. Adds filter control for a table to a filter page as specified by a RecordRef variable. |
| ADDTABLE Function | New function. Adds filter control for a table to a filter page. |
| BINDSUBSCRIPTION Function | New function. Binds event subscribers to the subscriber codeunit instance for handling events. |
| UNBINDSUBSCRIPTION | New function. Unbinds event subscribers from the subscriber codeunit instance for handling events. |
| COUNT Function (FilterPageBuilder) | New function. Gets the number of filter controls that are specified in the FilterPageBuilder object instance. |
| CREATEENCRYPTIONKEY | Changed function. Includes a Boolean return value. The value is true if an encryption key is created successfully; otherwise, it is false. |
| CURRENTCLIENTTYPE Function | New function. Gets the Microsoft Dynamics NAV client type that is running on the current session. |
| CURRENTCOMPANY Function (Record) | New function. Gets the current company of a database table record. |
| CURRENTCOMPANY Function (RecordRef) | New function. Gets the current company of a database table that is referred to by a RecordRef. |
| DEFAULTCLIENTTYPE Function | New function. Gets the default Microsoft Dynamics NAV client type that is configured for the Microsoft Dynamics NAV Server instance that is used for the current session. |
| GETASCENDING Function (Record) | Gets the sort order for the records returned, such as in data from an ODATA web service. |
| GETURL Function | Changed function. Includes the following changes:
|
| GETVIEW function (FilterPageBuilder) | New function. Gets the filter view (which defines the sort order, key, and filters) for the record in the specified filter control of a filter page. |
| IMPORTENCRYPTIONKEY | Changed function. Includes a Boolean return value. The value is true if an encryption key is imported successfully; otherwise, it is false. |
| ISFILTERPAGEBUILDER Function (Variant) | New function. Indicates whether a C/AL variant contains a FilterPageBuilder variable. |
| ISTEMPORARY Function (Record) | New function. Determines whether a record refers to a temporary table. |
| NAME Function (FilterPageBuilder) | New function. Gets the name of a table filter control that is included on a filter page based on an index number that is assigned to the filter control. |
| RECORDID (Record) | New function. Gets the RecordID of the record that is currently selected in the table. |
| RUNMODAL Function (FilterPageBuilder) | New function. Builds and runs the filter page. |
| SETASCENDING Function (Record) | Sets the sort order for the records returned, such as in data from a ODATA web service. |
| SETVIEW Function | New function. Sets the current filter view, which defines the sort order, key, and filters, for a record in a filter control on a filter page. |
| GETDEFAULTTABLECONNECTION Function (Database), HASTABLECONNECTION Function (Database), REGISTERTABLECONNECTION Function (Database), SETDEFAULTTABLECONNECTION Function (Database), and UNREGISTERTABLECONNECTION Function (Database) | New functions. Registers, sets, gets, and unregister table connections to external tables. |
Thursday, 20 August 2015
Database Function
EXPORTDATA Function (Database)
Exports data from the Microsoft Dynamics NAV database to a file. The data is not deleted from the database.
Syntax
Parameters
ShowDialog
Type: Boolean
Specifies if you want to display a dialog box where the user can confirm the action.
FileName
Type: Text
Specifies the name and location of the file that the data must be exported to. The file must have the .navdata extension.
IncludeApplication
Type: Variable
Specifies if you want to export the application objects.
Create a variable of type Boolean to specify this parameter.
IncludeApplicationData
Type: Variable
Specifies if you want to export the data that defines the application in the database. This includes the permissions, permission sets, profiles, and style sheets.
Create a variable of type Boolean to specify this parameter.
IncludeGlobalData
Type: Variable
Specifies if you want to export global, non-company specific data.
Create a variable of type Boolean to specify this parameter.
CompanyRecord
Type: Record
Specifies the company or companies that must be imported.
You can find the usage of this function in Std. Page Object 9901 [Export Data]

IMPORTDATA Function (Database)
Imports data from a file that has been exported from a Microsoft Dynamics NAV database.
Syntax
Parameters
ShowDialog
Type: Boolean
Specifies if you want to display a dialog box where the user can confirm the action.
FileName
Type: Text
Specifies the name and location of the file that must be imported. The file must have been exported from a Microsoft Dynamics NAV database.
IncludeApplicationData
Type: Variable
Specifies if you want to import the data that defines the application in the database. This includes the permissions, permission sets, profiles, and style sheets.
Create a variable of type Boolean to specify this parameter.
IncludeGlobalData
Type: Variable
Specifies if you want to import global, non-company specific data.
Create a variable of type Boolean to specify this parameter.
CompanyRecord
Type: Record
Specifies the company or companies that must be imported.
You can find the usage of this function in Std. Page Object 9900 [Import Data]

DATAFILEINFORMATION Function (Database)
Specifies data from a file that has been exported from a Microsoft Dynamics NAV database.
Syntax
Parameters
ShowDialog
Type: Boolean
Specifies if you want to display a dialog box where the user can confirm the action.
FileName
Type: Text
Specifies the name and location of the file that you want to read information from. The file must have been exported from a Microsoft Dynamics NAV database.
HasApplication
Type: Variable
Specifies if the file contains application objects.
Create a variable of type Boolean to specify this parameter.
HasApplicationData
Type: Variable
Specifies if the file contains the data that defines the application in the database. This includes the permissions, permission sets, profiles, and style sheets.
Create a variable of type Boolean to specify this parameter.
HasGlobalData
Type: Variable
Specifies if the file contains global, non-company specific data.
Create a variable of type Boolean to specify this parameter.
tenantId
Type: Variable
Specifies the tenant ID of the database that the data was exported from.
Create a variable of type Text to specify this parameter.
exportDate
Type: Variable
Specifies the date and time when the data was exported.
Create a variable of type DateTime to specify this parameter.
CompanyRecord
Type: Record
Specifies the company or companies in the file.
You can find the usage of this function in Std. Page Object 9900 [Import Data]
Exports data from the Microsoft Dynamics NAV database to a file. The data is not deleted from the database.
Syntax
[Ok:=] EXPORTDATA(ShowDialog, FileName[, IncludeApplicationData][, IncludeGlobalData][, CompanyRecord])
Parameters
ShowDialog
Type: Boolean
Specifies if you want to display a dialog box where the user can confirm the action.
FileName
Type: Text
Specifies the name and location of the file that the data must be exported to. The file must have the .navdata extension.
IncludeApplication
Type: Variable
Specifies if you want to export the application objects.
Create a variable of type Boolean to specify this parameter.
IncludeApplicationData
Type: Variable
Specifies if you want to export the data that defines the application in the database. This includes the permissions, permission sets, profiles, and style sheets.
Create a variable of type Boolean to specify this parameter.
IncludeGlobalData
Type: Variable
Specifies if you want to export global, non-company specific data.
Create a variable of type Boolean to specify this parameter.
CompanyRecord
Type: Record
Specifies the company or companies that must be imported.
You can find the usage of this function in Std. Page Object 9901 [Export Data]

IMPORTDATA Function (Database)
Imports data from a file that has been exported from a Microsoft Dynamics NAV database.
Syntax
[Ok:=] IMPORTDATA(ShowDialog, FileName[, IncludeApplicationData][, IncludeGlobalData][, CompanyRecord])
Parameters
ShowDialog
Type: Boolean
Specifies if you want to display a dialog box where the user can confirm the action.
FileName
Type: Text
Specifies the name and location of the file that must be imported. The file must have been exported from a Microsoft Dynamics NAV database.
IncludeApplicationData
Type: Variable
Specifies if you want to import the data that defines the application in the database. This includes the permissions, permission sets, profiles, and style sheets.
Create a variable of type Boolean to specify this parameter.
IncludeGlobalData
Type: Variable
Specifies if you want to import global, non-company specific data.
Create a variable of type Boolean to specify this parameter.
CompanyRecord
Type: Record
Specifies the company or companies that must be imported.
You can find the usage of this function in Std. Page Object 9900 [Import Data]

DATAFILEINFORMATION Function (Database)
Specifies data from a file that has been exported from a Microsoft Dynamics NAV database.
Syntax
[Ok:=] DATAFILEINFORMATION(ShowDialog, FileName, Description, HasApplication, HasApplicationData, HasGlobalData, tenantId, exportDate, CompanyRecord)
Parameters
ShowDialog
Type: Boolean
Specifies if you want to display a dialog box where the user can confirm the action.
FileName
Type: Text
Specifies the name and location of the file that you want to read information from. The file must have been exported from a Microsoft Dynamics NAV database.
HasApplication
Type: Variable
Specifies if the file contains application objects.
Create a variable of type Boolean to specify this parameter.
HasApplicationData
Type: Variable
Specifies if the file contains the data that defines the application in the database. This includes the permissions, permission sets, profiles, and style sheets.
Create a variable of type Boolean to specify this parameter.
HasGlobalData
Type: Variable
Specifies if the file contains global, non-company specific data.
Create a variable of type Boolean to specify this parameter.
tenantId
Type: Variable
Specifies the tenant ID of the database that the data was exported from.
Create a variable of type Text to specify this parameter.
exportDate
Type: Variable
Specifies the date and time when the data was exported.
Create a variable of type DateTime to specify this parameter.
CompanyRecord
Type: Record
Specifies the company or companies in the file.
You can find the usage of this function in Std. Page Object 9900 [Import Data]
Labels:
2015,
Database,
Database Functions,
Development Tips,
Dynamics,
Functions,
Microsoft,
MS,
Nav,
Navision
Subscribe to:
Posts (Atom)