Development Tips, Excel, How To, Office Integration, Report

Add relationships to Data Model in PowerPivot

You can systematically create table relationships for all new tables that you import. If you’re sharing the workbook with colleagues, having predefined relationships will be appreciated if they don’t know the data as well as you do.

When creating relationships manually, you will work with two tables at a time.

For each table, you’ll choose columns that tell Excel how to look up/ join related rows in another table.

Recall from my previous posts I will be continuing the example from using same Data Model

PowerPivot Creating a Data Model in Excel 2013

Adding more tables to the Data Model using Existing Connection – In PowerPivot

With your Data model sheet opened
PowerPivot-14
Click on Diagram View in Upper Right Side as highlighted in above screenshot.

Window will switch to Diagram View as shown in above screenshot, showing all the tables available in the Data model.

Click No_ in Customer Table and Drag to Item Ledger Entry Table and release the mouse button pointing to Source No_ field, you will see the Link is Established between these two tables showing the Link via Arrow line.

Repeat above step again between Item->No_ and Item Ledger Entry -> Item No_ fields.

Now we have Established connection between these three tables Customer, Item & Item Ledger Entry.

I will come up with more option on this topic in my next post, till then start practicing and stay tuned.

Development Tips, Excel, How To, Office Integration, PowerPivot, Report

Adding more tables to the Data Model using Existing Connection – In PowerPivot

For Introduction please see PowerPivot for Excel

Recall from my earlier post we have created a connection to SQL Navision Database in my previous post.

PowerPivot Creating a Data Model in Excel 2013

I will be modifying same connection to include more tables to the Data model.
PowerPivot-10

Click on PowerPivot-> Manage.

From the PowerPivot Sheet click on Existing Connections.

This will open Connection Window Listing all available connection to PowerPivot for this Sheet.

Double Click the Connection in my case Nav2015DB_SQL_Connection.
PowerPivot-6

Select first option as we used in previous post and then Next for next Step.
PowerPivot-11
Select Item & Item Ledger Entry Tables and then Finish to import Data to the Sheet.
PowerPivot-12
On Success Click Close to return to Data Model Sheets.
PowerPivot-13

You will find two new sheets have been added to PowerPivot Sheet.

I will come up with more option on this topic in my next post, till then start practicing and stay tuned for more details & Updates on this topic.

Development Tips, Excel, How To, Jet Reports, Office Integration, Report

How to Use the Jet Report Scheduler

Overview

The Jet Scheduler is a powerful tool that allows users to schedule reports to be automatically run by the Windows Task Scheduler. The user can also control where the output file is saved to, if the report should be emailed once it has been generated, and the output format of the report.

Creating a New Scheduled Task

To set up a scheduled report, open the report in Excel, click the Jet ribbon, and click the Schedule button.

JetSchedule-1

Click the New Task… button to schedule a new task.

JetSchedule-2

The Scheduled Task window will now appear.

Reports Tab

JetSchedule-3

The Reports tab contains general information about the scheduled task.

  • Task Name: This represents the name of the task as it will appear in the Scheduled Task window to the user.
  • Run All Reports in a Folder: This button will enable the user to schedule all Jet Reports in a full to be run
  • Run a Single Report: This button will enable the user to schedule a single Jet Report to be run
  • Input: This represents the folder and file name of the report that will be run
  • Output: This represents the folder and file name of where the finished report will be saved

Schedule Tab

JetSchedule-4

This tab will define the frequency of how often the report will be run as well as if the task is currently disabled and if the report should be run when the user is logged off.

The available options for the frequency are:

  • Once: The report will only be run one time
  • Daily: The report will be run every day (it is possible to set on the next tab the number of days to wait between runs)
  • Weekly: The report will be run every week (it is possible to set on the next tab the days of the week for the report to be run on)
  • Monthly: The report will be run every month (it is possible to set on the next tab the months for the report to run on and the days of the month for the report to be run on)
  • When Idle: The report will run every time that the computer goes into idle mode
  • At Startup: The report will be run each time that the computer is turned on
  • At Logon: The report will be run each time that the user logs on to the computer

Frequency Tab

JetSchedule-5

The name of this tab will change depending on the frequency specified on the Schedule tab.

In the screenshot above a Weekly frequency has been specified.

  • Start Date and Time: This represents the first date that the report will run and the time that it will run for this and subsequent schedules
  • Weeks between report runs: This specifies how many weeks the Scheduler will wait between report runs before running the report again
  • Days to run report: This represents the days of the week that the report is scheduled to run on

Email Tab
JetSchedule-6
The Email tab allows the user to define who the report will be sent to if emailing is desired.

  • Send email: If this box is checked it will enable the report to be emailed to recipients
  • Mail properties: This dropdown will allow the user to specify whether the report will be emailed using Outlook or a generic SMTP protocol. SMTP must be configured in the Jet Essentials Application Settings in order for it to be used.
  • Message: This allows the user to specify a custom subject or body to be sent as part of the email
  • Attach report to email: If this box is checked the report will be attached to the email. If the box is unchecked the report will not be attached. This can be used as a type of notification when used in conjunction with the subject and body of the email to allow a user to know that the report has been run
  • Recipients: Email addresses will be specified here for all recipients of the report. Email addresses should be separated by a semi-colon.
  • Get recipients from Excel Named Range: It is possible to also define the email addresses in the report itself and then assign an Excel named range to the cell(s). If there are named ranges in the report then they will appear in the dropdown below the checkbox. The Output tab allows the user to define how the file should be saved once it is finished running. This tab also enabled the user to turn on logging to troubleshoot errors with the Scheduler process as well as use Batch File Generation for the reports.

Output Tab
The Output tab allows the user to define how the file should be saved once it is finished running. This tab also enabled the user to turn on logging to troubleshoot errors with the Scheduler process as well as use Batch File Generation for the reports.

JetSchedule-7

  • Output Format: This dropdown list will allow the user to define the format of the finished report. The available options are:
    • Jet Workbook: This will save the report as a normal Excel file with all Jet Reports functions still in the report
    • Values Only Workbook: This will save the report as an Excel file with all Jet Reports functions removed. The recipient would not be able to refresh the report as it will be a static Excel file
    • Web Page: This will save the report as a HTML file with a single sheet. This should be used when there is a single sheet in the report
    • Web Page by Sheet: This will save the report as a HTML file with multiple sheets embedded in it. This should be used when there are multiple sheets in a report
    • PDF: This will save the report as a PDF file (if your version of Excel supports that ability – Excel 2007 and higher)

Remain tuned for more details, I will come up with more details and features in my upcoming posts.

How To, Instalation & Configuration

How to: Test the ADCS Connection

The following procedure demonstrates how to use Windows Services and Telnet to test your Automated Data Capture System connection.

Before you can begin, you must install the ADCS component as part of a customized installation of Microsoft Dynamics NAV. For more information, see my earlier post Installing ADCS

To configure and start the Microsoft Dynamics NAV VT100 Plugin service

From the Windows Start menu, in the Start Search box, enter services.msc, and then press the Enter key. The Services window opens.

Right-click the Microsoft Dynamics NAV VT100Plugin service, and then choose Properties.

To specify the user account that the service can use to log on, choose the Log On tab.
ADCS-11
To specify an account, choose This account, choose Browse, and then specify a user account in the Select User dialog box. When you are finished, choose the OK button. The format is as follows:

<Domain>\<Windows User ID>

Note: To complete testing, you must also add the same user to Microsoft Dynamics NAV, with an appropriate permission set.

Type the password for the user account in Password and in Confirm password, and then choose the OK button.

On the General tab, choose Start.

To verify that the service is running

Start the Windows Event Viewer. From the Windows Start menu, in the Start Search box, enter eventvwr.msc, and then press the Enter key.

In the Windows Logs console tree, choose Application, and then locate event information for the Microsoft Dynamics NAV VT100 Plugin.
ADCS-12
Testing Your Connection

In the following procedure, you will open a terminal connection and use HyperTerminal to simulate using handheld devices. HyperTerminal is a program that you can use to connect to other computers, Telnet sites, bulletin board systems (BBSs), online services, and host computers. HyperTerminal connections are made using a modem, a null modem cable (used to emulate modem communication), or an Ethernet connection.

Note: HyperTerminal is no longer included with Windows. You can usually find a free downloadable version on the Internet.

To test your ADCS connection

Start your HyperTerminal application.

Enter a name for the connection. Choose the OK button.

In the Connect Using list, select TCP/IP (Winsock).

The following table describes the details of a local installation on one machine.

Detail Description Example
Host Address IP address of the machine that is running the VT100 Plug-in service. localhost
Port Number Port number that the VT100 Plug-in is listening on. 6666

Choose the OK button. The HyperTerminal window opens.
ADCS-13
Enter a user ID and password. Press Enter after every step.
ADCS-14
Select a warehouse activity option. For example, enter 1 in the Choose field if you want to simulate working with pick documents.
ADCS-15
You can review the data about warehouse picks in Microsoft Dynamics NAV. For example, you can use the data in the CRONUS International Ltd. demonstration database to send information from and to Microsoft Dynamics NAV.

Note: To see the interaction between Microsoft Dynamics NAV and ADCS, in CRONUS International Ltd., you can use warehouse activities that are located in the White warehouse. It is preconfigured to use ADCS.

How To, Instalation & Configuration

How to: Configure ADCS Options

Before you can work with Automated Data Capture Systems (ADCS), you have to configure Microsoft Dynamics NAV by modifying the VT100Plugin configuration file.

Important: Modification of the configuration file should only be performed by a system administrator.

To modify and update the ADCS configuration file for the terminal listener

Locate and open the NavisionVT100Plugin.exe.config configuration file. It is typically located in the following location: C:\Program Files (x86)\Microsoft Dynamics NAV\80\Automated Data Capture System.
ADCS-9
For the Terminal element, update the attributes in the configuration file using attributes as described in the following table. You specify the attribute values in quotation marks.

Attribute Description
listenIP Required. IP address that specifies where to listen for terminal connections.
listenPort Required. Positive integer that specifies the port number to listen for terminal connections.
stylesheet Required. Path to transformation style sheet, which transforms warehouse functions to terminal keycodes. Two style sheets are provided with the ADCS installation.
screenLines Optional. Positive integer that specifies the number of screen lines. The default is 5.
screenWidth Optional. Positive integer that specifies the screen width. The default is 30.
codePage Optional. Positive integer that specifies the codepage. The default is the system codepage defined in HKey_Local_Machine\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP.
terminalTimeout Optional. Positive integer that specifies the terminal time-out in milliseconds. The default is 65000 and cannot be fewer than 6000.
debugDirectory Optional. Output directory for debug data.

For the Endpoints element, update the attributes in the configuration file and modify an endpoint to support your processes. You can also add more endpoints. The following table provides some options.

Attribute Description
defaultType Optional. defaultType is an attribute of the Endpoints element. It specifies what type of endpoint to use when no type is specified, if you want to customize it. The default is the NavEndpoint type.
name Required. Endpoint name. The name must be unique.
url Required. Endpoint URL address.

Note: This attribute does not have to be included if the clientEndpointName attribute is specified.

type Optional. Fully qualified name of a non-default endpoint.
clientEndpointName Optional. Windows Communications Foundation client endpoint configuration name. If specified, a WCF configuration with the specified name must exist.

The following example describes the XML for a Terminal element and the Endpoints element. It adds one endpoint for Microsoft Dynamics NAV.

In my case the config file will be as below:
ADCS-10

======================================================================

<?xml version=”1.0″?>

<configuration>

<configSections>

<section name=”VT100″ type=”Microsoft.Dynamics.Nav.Adcs.Configuration.VT100ConfigurationSection, Microsoft.Dynamics.Nav.VT100Plugin”/>

</configSections>

<VT100>

<Warehouse>

<Endpoints>

<add name=”NavWSEndpoint” url=”http://indel-axt5283n1.tecturacorp.net:8047/DynamicsNAV80/WS/CRONUS%20International%20Ltd./Codeunit/ADCS”/&gt;

<!– Azure deployment example: –>

<!–<add name=”NavWSEndpoint” url=”https://CloudService:7047/DynamicsNAV/WS/CRONUS%20International%20Ltd/Codeunit/ADCS&#8221; UserName=”NavUser” Password=”NavUserPassword” />–>

</Endpoints>

</Warehouse>

<Terminal listenPort=”6666″ listenIP=”127.0.0.1″ stylesheet=”VT100_W2k_and_OtherClients.xsl”/>

</VT100>

<startup><supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.5″/></startup></configuration>

=============================================================================

Security

By default, the NavEndpoint uses the security settings that you have specified for web services generally. You can configure additional security by changing the configuration of Microsoft Dynamics NAV Server and matching that configuration in the VT100Plugin configuration service.

How To, Instalation & Configuration

How to: Enable Web Services for ADCS

To use Automated Data Capture System, you must enable the ADCS web service.

To enable and publish the ADCS web service

Start the RoleTailored client.

In the Search box, enter Web Services, and then choose the related link.

On the Home tab, choose New.

In the Web Services window, enter the following information on a new line:

Field Value
Object Type Codeunit
Object ID 7714
Service Name ADCS

Important: It is required that you name the service ADCS.

Select the Published check box.

Choose the OK button.
ADCS-7
To verify that the web service has been published

In a web browser window, enter a URL in the following format: http://<web services path>/Services. The following example demonstrates the results.

In my case:

http://indel-axt5283n1.tecturacorp.net:8047/DynamicsNAV80/WS/Services

You see the following XML information if the ADCS web service is published.
ADCS-8

To verify that the codeunit is performing as expected, enter a URL in the following format: http://<web services path>/Codeunit/<Service Name>.

http://indel-axt5283n1.tecturacorp.net:8047/DynamicsNAV80/WS/CRONUS%20International%20Ltd./Codeunit/ADCS

Information about the ADCS web service is displayed.

How To, Instalation & Configuration

How to: Add Users for ADCS

You can add any user as a user of an Automated Data Capture System (ADCS). When you do this, the user must also provide a password. Optionally, you can also provide a connection that identifies the ADCS user as a warehouse employee. The ADCS user password can be different from the Windows logon password of the user.

To add an ADCS user

In the Search box, enter ADCS Users, and then choose the related link.

On the Home tab, choose New to add a new user.

In the Name field, enter a name for the user. The name cannot contain more than 20 characters, including spaces.

In the Password field, enter a password. The password is masked.
ADCS-5
To indicate that a warehouse employee is an ADCS user

In the Search box, enter Warehouse Employees, and then choose the related link.

If needed, add a new warehouse employee

On the Home tab, in the Manage group, choose Edit List.

Select a warehouse employee from the list. In the ADCS User field, choose the drop-down arrow, and then select the name of an ADCS user from the list.

Note : The default warehouse for the employee should be one that uses ADCS
ADCS-6

Development Tips, How To

How to: Install a Windows Client Control Add-in Assembly

Microsoft Dynamics NAV Windows client control add-ins are provided in one or more Microsoft Framework .NET-based assemblies, which are .dll files. Control add-in assemblies must be installed on the following computers:

  • Computers that are running the Microsoft Dynamics NAV Windows client. Any Microsoft Dynamics NAV Windows client instance that will use the control add-ins, must be installed with the control add-in assemblies. Control add-in assemblies are not installed with the default Microsoft Dynamics NAV Windows client installation.
  • Computer that is running the Microsoft Dynamics NAV Development Environment. After a control add-in is installed, you use the development environment to register the control add-in the Client Add-in table in the Microsoft Dynamics NAV database and set it up on pages.

Optionally, if a control add-in has the same name as the assembly, you can install the assembly on the computer that is running Microsoft Dynamics NAV Server instead of the client computer.

To install control add-in assemblies on the Microsoft Dynamics NAV Windows client

  • If needed, install the Microsoft Dynamics NAV Windows client on the computer.
  • On the computer that is running the Microsoft Dynamics NAV Windows client, copy the assemblies that contain the control add-ins to the Add-ins folder of the Microsoft Dynamics NAV Windows client installation.
    • By default, the path of this folder is C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Add-ins.

You can also include assemblies in a subfolder of the Add-ins folder. This can be useful if you have multiple assemblies and dependencies.

To install control add-in assemblies on the development environment computer

  • If needed, install the development environment on the computer.
  • On the computer that is running the development environment, create a folder named Add-in in the development environment installation folder.
    • By default, the path of this folder is C:\Program Files\Microsoft Dynamics NAV\80\Classic. If the Add-in folder already exists, then ignore this step.
  • Copy the assemblies that contain the control add-ins to the Add-ins folder.

You can also include assemblies in a subfolder of the Add-ins folder. This can be useful if you have multiple assemblies and dependencies.

Installing Control Add-ins on Microsoft Dynamics Server for Automatic Deployment

If a control add-in has the same name as the assembly, then you can install the assembly on computer that is running Microsoft Dynamics NAV Server. When an operation from the client requires the control add-in, Microsoft Dynamics NAV Server automatically deploys the assembly to a temporary folder on the client computer.

For example, if Microsoft Dynamics NAV Windows client opens a page that contains a control add-in, Microsoft Dynamics NAV Server will find the control add-in assembly by name in the Add-ins folder. Then, it deploys the assembly to the client computer in the %TEMP%\Microsoft Dynamics NAV\Add-Ins folder of the user who is running the client. The deployed assembly will be then be used whenever the page is opened.

Similarly, if the development environment requires a control add-in, for example, when you compile an object, then the control add-in assembly will be deployed by the Microsoft Dynamics NAV Server to the local temporary folder for the current user on the computer that is running the development environment.

To be deployed, an assembly must comply with the following Microsoft Dynamics NAV Server configuration settings: Chunk Size, Max Upload Size, and Prohibited File Types.

If the control add-in assembly is updated and its version number changes, Microsoft Dynamics NAV Server will deploy the updated assembly to the client computer the next time that the client requests the assembly. The updated assembly is put in a subfolder of the %TEMP%\Microsoft Dynamics NAV\Add-Ins folder, where the subfolder has the assembly’s version number as its name. This implementation means that you do have to remove the older versions of assemblies that are stored on the client computer.

Before Microsoft Dynamics NAV Server deploys an assembly to a client, the client looks for the assembly in the local Add-ins folder (for example, C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Add-ins). If the assembly is not found, then the client will request the assembly from Microsoft Dynamics NAV Server.

To install the control add-in on Microsoft Dynamics NAV Server

  • On the computer that is running the Microsoft Dynamics NAV Server, copy the assembly that contains the control add-in to the Add-ins folder of the Microsoft Dynamics NAV Server installation.

By default, the path is C:\Program Files\Microsoft Dynamics NAV\80\Service\Add-ins.

Development Tips, How To

How to: Set .NET Framework Types to Run on the Microsoft Dynamics NAV Windows Client or Microsoft Dynamics NAV Server Computers

Here is the brief description for how to set .NET Framework objects that are instantiated by DotNet variables to target either the Microsoft Dynamics NAV Windows client or Microsoft Dynamics NAV Server.

By default, a type is set to target Microsoft Dynamics NAV Server. However, you can set the type to target the Microsoft Dynamics NAV Windows client.

Setting the .NET Framework Type to Target the Microsoft Dynamics NAV Windows Client

To set a .NET Framework type instance to target the Microsoft Dynamics NAV Windows client, you must complete the following tasks:

  • Set the DotNet variable for the .NET Framework type to target the Microsoft Dynamics NAV Windows client.
  • Copy the .NET Framework assembly to the computer that is running the Microsoft Dynamics NAV Windows client.

You must copy the assembly to each computer that is running the Microsoft Dynamics NAV Windows client. If the assembly is included in the global assembly cache, then you do not have to do this task.

For the Microsoft Dynamics NAV Web client, you cannot implement Microsoft .NET Framework interoperability objects that target the client.

To set the .NET Framework type to target the Microsoft Dynamics NAV Windows client

  • In Object Designer, open the C/AL code of the Microsoft Dynamics NAV object that uses .NET Framework interoperability.
  • Do one of the following steps:
    • For a global variable, on the View menu, choose C/AL Globals.
    • For a local variable, select the trigger that uses the variable, and then on the View menu, choose C/AL Locals.
    • On the Variables tab, select the DotNet variable, and then on the View menu, choose Properties.
    • In the Properties window, set the RunOnClient property to Yes

To copy a .NET Framework assembly to a computer that is running the Microsoft Dynamics NAV Windows client

    • On the computer that is running the Microsoft Dynamics NAV Windows client, copy the.NET Framework assembly to the Add-ins folder of the Microsoft Dynamics NAV Windows client installation.

By default, the path of this folder is C:\Program Files\Microsoft Dynamics NAV\80\RoleTailored Client\Add-ins or C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Add-ins.

You can also put assemblies in a subfolder of the Add-ins folder. This can be useful when you have multiple versions of the same assemblies and dependencies.

Setting the .NET Framework Type to Target Microsoft Dynamics NAV Server

To set a .NET Framework type instance to target Microsoft Dynamics NAV Server, you must complete the following tasks:

  • Set the variable for the NET Framework type to target Microsoft Dynamics NAV Server.
  • Copy the .NET Framework assembly to the computer that is running Microsoft Dynamics NAV Server.

If the assembly is included in the global assembly cache of the computer that is running Microsoft Dynamics NAV Server, then you do not have to do this task.

To set the .NET Framework type to target Microsoft Dynamics NAV Server

  • In the development environment, in Object Designer, open the object that uses the .NET Framework variable.
  • Do one of the following steps:
    • For a global variable, on the View menu, choose C/AL Globals.
    • For a local variable, in the C/AL Editor, select the trigger that uses the DotNet variable, and then on the View menu, choose C/AL Locals.
    • On the Variables tab, select the NET Framework variable type, and then on the View menu, choose Properties.
    • In the Properties window, set the RunOnClient property to No

To copy a .NET Framework assembly to the computer that is running Microsoft Dynamics NAV Server

    • On the computer that is running Microsoft Dynamics NAV Server, copy the.NET Framework assembly to the Add-ins folder of the Microsoft Dynamics NAV Server installation folder.

By default, the path of the Microsoft Dynamics NAV Server installation folder is C:\Program Files\Microsoft Dynamics NAV\80\Service\Add-ins.

You can also put assemblies in a subfolder of the Add-ins folder. This can be useful when you have multiple assemblies and dependencies.

If you are working in the development environment, to compile and test Microsoft Dynamics NAV objects, you must also copy the assembly to the Add-ins folder of the Microsoft Dynamics NAV Windows client installation on the computer that is running the development environment. By default, the path of this folder is C:\Program Files\Microsoft Dynamics NAV\80\RoleTailored Client\Add-ins or C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Add-ins.

Development Tips, License, Multitenancy, Server

Uploading License to Tenant in Multitenant Environment

When we deploy solution for Multitenant Environment ever Tenant will be required a Separate License. Depending upon the License agreement with Microsoft every Tenant will either share same License or individual License.

Assume we are implementing Distributor Management System. Where every Tenant is a different Business entity linked with the Parent Group.

In this case the Server & Network is provided by the Parent Group and other Business group will share information but they will use their specific License to use the system, doesn’t matter who pays for fee.

In any case we need to upload License to each database in Multitenancy.

Import-NAVServerLicense

Imports a license file into a Microsoft Dynamics NAV database.

Syntax

Parameter Set: __AllParameterSets

Import-NAVServerLicense [-ServerInstance] <String> [-Database <LicenseDatabase> ] [-Force] [-Tenant <TenantId> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: LicenseDataSet

Import-NAVServerLicense [-LicenseData] <Byte[]> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: LicenseFileSet

Import-NAVServerLicense [-LicenseFile] <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Use the Import-NAVServerLicense cmdlet to import a license file into a Microsoft Dynamics NAV database. If the Microsoft Dynamics NAV Server account specified does not have access to the location where the license file is stored, an error results. Check the Event Log on the Microsoft Dynamics NAV Server computer to see what permissions are required.

After importing a new license, restart all Microsoft Dynamics NAV Server instances to activate the license for client users.

Parameters

-Database<LicenseDatabase>

Specifies the database into which to import the license file. The possible values are described in the following list:

Default = 0

Default; overrides the license file currently in use.

Master = 1

Forces the license file to be global.

NavDatabase = 2

Forces the license file to be local and stored in the Microsoft Dynamics NAV database that is used by the specified Microsoft Dynamics NAV Server instance.

Tenant = 3

Forces the license file to be local and stored in the Microsoft Dynamics NAV database that is used by the tenant that is specified in the Tenant parameter.

Aliases none
Required? false
Position? named
Default Value none
Accept Pipeline Input? false
Accept Wildcard Characters? false

-Force

Forces the command to run without asking for user confirmation.

Aliases none
Required? false
Position? named
Default Value none
Accept Pipeline Input? false
Accept Wildcard Characters? false

-LicenseData<Byte[]>

Specifies the content retrieved from the certificate file by using the Get-Content cmdlet. For more information, see the examples.

Aliases none
Required? true
Position? 2
Default Value none
Accept Pipeline Input? false
Accept Wildcard Characters? false

-LicenseFile<String>

Aliases none
Required? true
Position? 2
Default Value none
Accept Pipeline Input? false
Accept Wildcard Characters? false

-ServerInstance<String>

Specifies the name of a Microsoft Dynamics NAV Server instance. The default instance name is DynamicsNAV80. You can specify either the full name of an instance (such as MicrosoftDynamicsNavServer$myinstance) or the short name (such as myinstance).

Aliases none
Required? true
Position? 1
Default Value none
Accept Pipeline Input? True (ByValue, ByPropertyName)
Accept Wildcard Characters? false

-Tenant<TenantId>

Specifies the ID of the tenant in which you want to import the license, such as Tenant1. This parameter is required unless the specified service instance is not configured to run multiple tenants.

Aliases Id
Required? false
Position? named
Default Value none
Accept Pipeline Input? True (ByPropertyName)
Accept Wildcard Characters? false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required? false
Position? named
Default Value false
Accept Pipeline Input? false
Accept Wildcard Characters? false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required? false
Position? named
Default Value false
Accept Pipeline Input? false
Accept Wildcard Characters? false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.String

You can pipe a string that contains a Microsoft Dynamics NAV Server instance name to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

This cmdlet does not generate any output.

Examples

This example imports a license file that is named “fin.flf” from the current directory into the default database.

C:\PS>Import-NAVServerLicense DynamicsNAV80 -LicenseData ([Byte[]]$(Get-Content -Path “fin.flf” -Encoding Byte))

This example imports a license file that is named “fin.flf” from the current directory into the local Microsoft Dynamics NAV database that is used by the MyInstance Microsoft Dynamics NAV Server instance.

C:\PS>Import-NAVServerLicense MyInstance -LicenseData ([Byte[]]$(Get-Content -Path “fin.flf” -Encoding Byte)) -Database NavDatabase

This example imports a license file that is named “fin.flf” from the current directory into the master database.

C:\PS>Import-NAVServerLicense ‘MicrosoftDynamicsNavServer$MyInstance’ -LicenseData ([Byte[]]$(Get-Content -Path “fin.flf” -Encoding Byte)) -Database Master

This example imports a license file that is named “fin.flf” from the current directory into the database that is used by the specified tenant, Tenant1.

C:\PS>Import-NAVServerLicense ‘MicrosoftDynamicsNavServer$MyInstance’ -LicenseData ([Byte[]]$(Get-Content -Path “fin.flf” -Encoding Byte)) -Database Tenant –Tenant Tenant1

Let import the license to the Tenants which we created in our earlier post.

If you missed previous post you can find it here. Adding Tenants to multitenancy Environment

I have created the Folder and placed my Tenants License in this.

License-1

Set-ExecutionPolicy unrestricted -Force

Import-Module ‘C:\Program Files\Microsoft Dynamics NAV\80\Service\NavAdminTool.ps1’

Import-NAVServerLicense MTenantDemo -Tenant ‘Tenant-1’ -LicenseData ([Byte[]]$(Get-Content -Path “C:\User Data\NAV 2015\MultiTenantDemo\Tenant License\Tenant-1.flf” -Encoding Byte))

Import-NAVServerLicense MTenantDemo -Tenant ‘Tenant-2’ -LicenseData ([Byte[]]$(Get-Content -Path “C:\User Data\NAV 2015\MultiTenantDemo\Tenant License\Tenant-2.flf” -Encoding Byte))

Import-NAVServerLicense MTenantDemo -Tenant ‘Tenant-3’ -LicenseData ([Byte[]]$(Get-Content -Path “C:\User Data\NAV 2015\MultiTenantDemo\Tenant License\Tenant-3.flf” -Encoding Byte))

Import-NAVServerLicense MTenantDemo -Tenant ‘Tenant-4’ -LicenseData ([Byte[]]$(Get-Content -Path “C:\User Data\NAV 2015\MultiTenantDemo\Tenant License\Tenant-4.flf” -Encoding Byte))

Import-NAVServerLicense MTenantDemo -Tenant ‘Tenant-5’ -LicenseData ([Byte[]]$(Get-Content -Path “C:\User Data\NAV 2015\MultiTenantDemo\Tenant License\Tenant-5.flf” -Encoding Byte))

Copy the above Script and paste into the Microsoft Dynamics NAV 2015 Administration Shell.

License-2

Our License have now successfully uploaded to respective databases. As the message suggest we need to re-start the service so that new License comes into effect.

You can use above Script to Upload License to individual Tenants, License could be different or same depends how you discussed with Microsoft and purchased.