Development Tips

Page Properties Not Supported by Microsoft Dynamics NAV Web Client

Most page properties that are supported in the Microsoft Dynamics NAV Windows client are also supported in the Microsoft Dynamics NAV Web client.

There are some properties that are not supported by Microsoft Dynamics NAV Web client and other properties that are either partially supported or behave differently in the Microsoft Dynamics NAV Windows client.

Unsupported Properties

The properties that are not supported by the Microsoft Dynamics NAV Web client. When a page that contains an unsupported property is displayed in a browser, the property is ignored. You do not receive an error but the property does not affect the page.

  • ChartPartID Property
  • ColumnSpan Property
  • ControlAddin Property
  • FreezeColumnID Property
  • RowSpan Property
  • RefreshOnActivate Property
  • ShowAsTree Property
  • Style Property
  • StyleExpr Property
  • SystemPartID Property

Partially Supported Properties

The properties that either do not have all the capabilities in the Microsoft Dynamics NAV Web client as they do in Microsoft Dynamics NAV Windows client or they behave differently than in the Microsoft Dynamics NAV Windows client.

  • AssistEdit Property
  • DrillDown Property
  • DrillDownPageID Property
  • GroupType Property
  • Importance Property
  • IndentationControls Property
  • PageType Property
  • PartType Property
Advertisement
Development Tips

TextEncoding Property (XMLports)

Specifies the text encoding format to use when you use an XMLport to export or import data as text.

Note

The TextEncoding property is only available when the Format Property (XMLports) of the XMLport is set to Fixed Text or Variable Text.

Values

  • MS-DOS (default)
  • UTF-8
  • UTF-16
  • Windows

Remarks

Text encoding is the process of transforming bytes of data into readable characters for users of a system or program. There are several industry text encoding formats and different systems support different formats. Internally, Microsoft Dynamics NAV uses Unicode encoding. For exporting and importing data with an XMLport, Microsoft Dynamics NAV supports MS-DOS, UTF-8, UTF-16, and Windows encoding formats.

You should set the TextEncoding property to the encoding format that is compatible with the system or program that you will be exporting to or importing from. The following sections describe the available text encoding formats.

Tip

You can also set the TextEncoding property in C/AL code. For example, if your XMLport can import or export different formats based on certain conditions, you can change the encoding on the fly depending on the conditions. For example, you can write code such as the following:

currXMLport.TEXTENCODING := TEXTENCODING::Windows;

Example

The following code example illustrates how you can set the encoding during run time.

TextEncoding

Above screenshot is from XMLport 1220 in the CRONUS International Ltd. demonstration database.

Sample Code:

      CASE MyDefinitionTable.”File Encoding” OF

MyDefinitionTable.”File Encoding”::”MS-DOS”:

currXMLport.TEXTENCODING(TEXTENCODING::MSDos);

MyDefinitionTable.”File Encoding”::”UTF-8″:

currXMLport.TEXTENCODING(TEXTENCODING::UTF8);

MyDefinitionTable.”File Encoding”::”UTF-16″:

currXMLport.TEXTENCODING(TEXTENCODING::UTF16);

MyDefinitionTable.”File Encoding”::WINDOWS:

currXMLport.TEXTENCODING(TEXTENCODING::Windows);

The table, MyDefinitionTable, (Imaginary Table) has a field, File Encoding, (imaginary Field) that specifies the encoding for this part of an import.

Development Tips

AccessByPermission Property – in Navision 2015

Sets a value for a table field or UI element that determines the permission mask for an object that a user must have to see and access the related page fields or UI element in the client. The UI element will be removed at runtime if the user does not have permissions to a certain object as specified in the Access by Permission window.

AccessByPermission-1
AccessByPermission-2
AccessByPermission-3

Depending on the setting in the UI Elements Removal field in the Microsoft Dynamics NAV Server Administration tool, only user interface (UI) elements on objects in the license or on objects that the user has permissions to will appear in the user interface.

AccessByPermission-4

To make full use of the LicenseFileAndUserPermissions option in the UI Elements Removal field, it is recommended that you assign the special permission set, FOUNDATION, along with the relevant permission sets that define which application objects the user will access.

AccessByPermission-5

The majority of the permission sets that are provided with the CRONUS demonstration database cannot be combined with the FOUNDATION permission set to fully use the UI Elements Removal feature. You must first create or edit the relevant permission sets to avoid that the user is blocked from performing the involved tasks. You must first create or edit the relevant permission sets to avoid that the user is blocked from performing the involved tasks.

If you only use the LicenseFile option in the UI Elements Removal field, then you do not have to edit any permission sets as they will not affect which UI elements are removed.

To specify when UI elements are removed
  1. Open the Microsoft Dynamics NAV Server Administration
  2. In the UI Elements Removal field, choose the relevant option as described in the following table.
Option Description
None All UI elements are displayed, even if the license file does not include the related object and the user does not have permissions to the related object.
LicenseFile A UI element is removed if the related object is not included in the license file.
LicenseFileAndUserPermissions A UI element is removed if the related object is not included in the license file and the user does not have permissions to the object as defined in the AccessByPermission property for the related UI element.

By default, this option is selected.

AccessByPermission-6

When you configure user interfaces in Microsoft Dynamics NAV, you should make sure that the UI Elements Removal field is set to its default, LicenseFileAndUserPermissions, so that you only see the relevant UI elements in the Customize window.

When you develop in Microsoft Dynamics NAV, you should make sure that the UI Elements Removal field is set to its default, None, to make sure that all UI elements are visible when you review your development in the UI.

All types of UI elements will be removed if they relate to objects that are not included in the license or the user does not have the required permission to the objects:

  • Fields
  • Actions
  • Page parts

UI elements that are directly related to an object through the TableRelation or the CalcFormula property can be removed automatically according to the license file and/or user permissions.

For UI elements that are not directly related to an object, you can use the AccessByPermission property to remove the element according to the user’s permission to a related object

All types of UI elements will be removed if they relate to an object to which the user does not have the required permissions:

Fields on pages, including FactBoxes

Actions on pages, including toolbars and navigation panes

Page parts, such as Lines FastTabs

Note

To use this property, the UI Elements Removal field in the Microsoft Dynamics NAV Server Administration tool must be set to LicenseFile or LicenseFileAndUserPermissions.

This Property Applies To

Fields in tables (affecting all related fields on pages)

Fields on pages

Actions on pages

MenuSuite items

Page parts, such as a Lines FastTab

Property Value

When you choose the AssistEdit button, the Access By Permission window opens. Fill the fields as described in the following table.

Field Description
Object Type Specify the type of object to which permission is required to display the UI element.
Object ID Specify the object to which permission is required to display the UI element.
Read Specify if Read permission is required to display the UI element.
or Insert Specify if Insert permission is required to display the UI element.
or Modify Specify if Modify permission is required to display the UI element.
or Delete Specify if Delete permission is required to display the UI element.
or Execute Specify if Execute permission is required to display the UI element.

AccessByPermission-7

Note

If multiple permissions are selected, then one or the other applies.

Example: Remove the Unit Price field if the user does not have permission to the Sales Price table

Open table 27, Item Card, with the Table Designer.

View the properties of field 18, Unit Price.

For the AccessByPermission property, choose the AssistEdit button in the Value field.

In the Access By Permission window, fill the fields as described in the following table.

Field Description
Object Type TableData
Object ID Sales Price
Read Select
Insert Select
Modify Leave blank
Delete Leave blank
Execute Leave blank

Close the Access By Permission window and save the changes on table 27.

All instances of the Unit Price field on pages are now removed if the user does have Read or Insert permission to the Sales Price table.

AccessByPermission-8

Important

If you defined the property for a table field, then all instances of the field on pages are removed. To override the property on an individual page field, delete the permission value after the = sign in the Value field. Do NOT delete the whole string as that will be replicated on the property of the table field.

Note

To use the LicenseFileAndUserPermissions option in the UI Elements Removal field, you must assign the special FOUNDATION permission set to the user along with the relevant application permission sets that define which application objects the user will access. Unlike the BASIC permission set, the FOUNDATION permission set only grants access to application setup and system tables and requires that other assigned permission sets define which specific application objects can be accessed.

Not all of the 167 default permission sets that are provided with Microsoft Dynamics NAV are ready to support the FOUNDATION permission set to remove UI elements according to user permissions. You must therefore edit the relevant permission sets as explained in the following procedures.

To experience how UI elements are removed for a user performing the task to create and edit a new customer, you can create a sample user interface based on default permission sets provided with Microsoft Dynamics NAV.

Special Permission Sets

The following permission sets have special definitions that you should be aware of as you implement permissions and security for Microsoft Dynamics NAV users.

Permission set Definition
SUPER Can read, use, update, and delete all data and all application objects in the scope of your license. Microsoft Dynamics NAV requires that at least one user be assigned this permission set in each database.

You cannot modify permissions for the SUPER permission set.

SUPER (DATA) Can read, use, update, and delete all data. You typically assign this permission set to an accounting manager who needs to work with all data but does not need to change Microsoft Dynamics NAV.

This permission set does not give access to the Object Designer.

SECURITY Can create new users and assign them the same permission sets. Must be able to access the User, User Property, Permission Set, and Access Control tables.

For example, you can create a SECURITY permission set that includes the four required tables and any additional permissions that you want to include. You can then assign this permission set to a user who is a department administrator. This user can then administer permissions for other users in their department.

Only a user who has the SUPER permission set can create and modify a SECURITY permission set. Users who have this permission set can assign the same permissions to other users, but they cannot assign themselves the SUPER permission set.

BASIC Grants Read access to almost all application tables and all system tables.

The main purpose of this permission set is to enable the client to open and show all pages.

When you create a new database, you must import the BASIC permission set from an XML file.

FOUNDATION A prerequisite for all other permission sets. The FOUNDATION permission set grants access to system tables and application setup tables that are required for most application features to work.

Note

This permission set is recommended when using the UI Elements Removal feature to automatically remove UI elements according to user permissions.

Development Tips

UpdatePropagation Property

Sets a value that specifies what happens when a main page with a subpage is updated.

The UpdatePropagation property is available on part controls and has two options; Subpage and Both.

If UpdatePropagation is set to Subpage, an update action will update the subpage only.

If UpdatePropagation is set to Both, an update action will update both the main page and the subpage.

This is useful if a value on the subpage changes, and you want a main page total to be refreshed automatically.

Use the UpdatePropagation property to update a main page total, when the amount on the subpage lines is updated. Add a CurrPage.UPDATE(); call, for example, in the OnValidate trigger on the subpage to have the UpdatePropagation property take effect.

Let’s do it practically how it works:

I am taking Sales Order for demo of above property.

Let’s start with adding a field in Sales Header Table
UpdatePropagation-1

I have added Total Line Amount as Flow field to Sum Line Amount from Lines.

Next I will add this field to Sales Order Page.
UpdatePropagation-2

If we run now and make changes in Lines the Total Line amount will not update until we refresh the Page. To enable auto refresh we will be required to add Update Propagation Property of the Subpage to Both.
UpdatePropagation-3

After doing this if I make any changes which changes the Line Amount for the lines, The Total Line Amount in Header will get updated automatically, we will not require to refresh the page.
UpdatePropagation-4

We are done, so simple.

Report

Designing Report Layouts from the Microsoft Dynamics NAV Development Environment

After you have created a dataset for a report, you design the report layout. The report layout determines how the report looks when it is viewed, printed, and saved from the Microsoft Dynamics NAV client. The report layout specifies which fields of the dataset are included in the report and how they are arranged, the format of text that appears on the report (such as font type and color), margins, background images, and more.

You generally display most data in the body of a report, and you use the header to display information before any dataset fields are displayed. For example, you can display a report title, company, and user information in the header of a report.

Report Layout Types

There are two types of report layouts: Word and Client Report Language Definition (RDLC). Word report layouts are based on a Word document (.docx file type) and are created and modified by using Word 2013. RDLC report layouts are .rdlc or .rdl file types that are created and modified by using Visual Studio 2013 or SQL Server Report Builder 3.0.

Built-in and Custom Report Layouts

In the Microsoft Dynamics NAV Development Environment, you can create both an RDLC report layout and Word report layout on a report. These layouts are referred to as built-in layouts because they are part of the report object in the database. This means, for example, if you export the report object as a .fob or .txt file, the RDLC report layout and Word report layout are included. A report can only have one built-in RDLC report layout and one built-in Word report layout. By default, the built-in RDLC report layout is used when the report is run in the Microsoft Dynamics NAV client unless there is only a built-in Word report layout, in which case, the built-in Word report layout is used.

Microsoft Dynamics NAV users can specify whether to use the built-in RDLC or Word report layout on a report from the Microsoft Dynamics NAV Windows client and Microsoft Dynamics NAV Web client. From the client, users can also create custom report layouts that are based on the built-in report layouts. This enables users to have several different layouts for the same report which they can switch among. Custom report layouts are managed from page 9650 Report Layouts in the Microsoft Dynamics NAV client. Unlike built-in report layouts, which are part of the report object, custom report layouts are stored in table 9650 Report Layouts of the database.

Report Layouts in a Multitenant Deployment

In a multitenant Microsoft Dynamics NAV deployment, the built-in report layouts are stored in the application database because they are part of the report objects. Therefore, built-in report layouts are available to all tenants. Custom report layouts are stored in the business data database; therefore they are specific to the tenant. This enables you to create separate report layouts for each tenant.

Report

Add Fields from a Report Dataset to a Word Report Layout

A report dataset can consist of fields that display labels, data, and images. This topic describes procedure for adding fields of a report dataset to an existing Word layout of a report. You add fields by using the Word custom XML part for the report and adding content controls that map to the fields of the report dataset.

To display the Custom XML part for the Report in Word

  1. Open the Word report layout document in Word for editing.
  2. Show the Developer tab in the ribbon of Word.

By default, the Developer tab is not shown in the ribbon.

  1. On the Developer tab, choose XML Mapping Pane.
  2. In the XML Mapping pane, in the Custom XML Part list, choose the XML part for Microsoft Dynamics NAV report. The name of the XML part has the following format:

urn:microsoft-dynamics-nav/reports/report_name/ID

report_name is the name that is assigned to the report as specified by the report’s Name Property.

ID is the identification number of the report.
XMLDataSet
After you select the XML part, the XML Mapping pane displays the labels and field controls that are available for the report.

To add a label or data field

  1. Place your pointer in the document where you want to add the control.
  2. In the XML Mapping pane, right-click the control that you want to add, choose Insert Content Control, and then choose Plain Text.

AddDataField

Note

You cannot add a field by manually typing the dataset field name in the content control. You must use the XML Mapping pane to map the fields.

To add repeating rows of data fields to create a list

  1. If not already existing, add a table row that includes a column for each field that you want repeated.

This row will act as a placeholder for the repeating fields.

  1. Select the whole row.
  2. In the XML Mapping pane, right-click the control that corresponds to the report data item that contains the fields that you want repeated, choose Insert Content Control, and then choose Repeating.

AddRepeatingField

  1. Add the repeating fields to the row as follows:
    1. Place your pointer in a column.
    2. In the XML Mapping pane, right-click the control that you want to add, choose Insert Content Control, and then choose Plain Text.

InsertContentField

  1. For each field, repeat steps a and b.
Show Mandatory Property

Show Mandatory Property

With Microsoft Dynamics NAV a new property called ShowMandatory has been introduced on page fields. The ShowMandatory property is set on page fields and marks the field with a red asterisk on the UI.

ShowMandatory Property

NOTE:The ShowMandatory property can be used to mark all page fields, but does not enforce any validation of the field. This means that the user will be able to close a page without entering data.