Saturday, June 21, 2014

Dynamics Navision Full User and Limited User Structure

  • Full User 

    Full User licenses provide users full read and full write capabilities to all of the licensed solution functionality through any and all modes of access, including the Microsoft Dynamics NAV Windows client, the Microsoft Dynamics NAV Web client, or any other mode of access including web services. Full User licenses are for users requiring unlimited read and write access. As long as the number of users needing simultaneous access to the solution does not exceed the number of Full User licenses you have acquired, these users are properly licensed for full read and write access to the complete solution functionality.
  • Limited User 

    Limited User licenses provide users full read, but limited write, capabilities to all of the licensed solution functionality through any and all modes of access including the Microsoft Dynamics NAV Windows client. The Limited User license is designed to give customers a lower-cost alternative for extending ERP to users who only require limited access to the Microsoft Dynamics NAV application:
    • Read access to data contained in the solution through any client accessing the application, including but not limited to the Microsoft Dynamics NAV Windows client, the Microsoft Dynamics NAV Web client, and web services.
    • Write access to a maximum of three application tables in the object range 0 – 99,999,999 other than the General Ledger Entry table, through any client accessing the application. Access to the General Ledger Entry Table requires a Full User license.
  • Device Only User 

    Device-only licenses enable a user to connect, provided there is an enabled device available to use. Devices can be full or limited. Device users have either full or limited access, as determined by the device.
  • Windows Group 

    Use this license type to create a Microsoft Dynamics NAV user based on a Windows group. All members of the group inherit permissions for the user.

    Windows Group licensing is a form of license multiplexing. Multiplexing does not reduce the number of user licenses required to access a Microsoft Dynamics NAV solution.
  • External User 

    This license type is specific to individual users of Microsoft Dynamics NAV 2013 R2. External user licenses must not be shared with other individual users. You do not need concurrent user CALs for external users. External users must not use any clients provided by the Microsoft Dynamics NAV 2013 R2 Application Programming Interface (API), such as the Microsoft Dynamics NAV Windows client or the Microsoft Dynamics NAV Web client. External user licenses must not be used for business process outsourcing purposes.


Wednesday, May 1, 2013

Job Queue and NAS in Microsoft Dynamics NAV

This article explains how to configure and use the Job Queue functionality in Microsoft Dynamics NAV together with the Navision Application Server (NAS) to run background tasks automatically, without user intervention.


Background: Job Scheduler vs Job Queue

The Job Queue feature was introduced in Microsoft Dynamics NAV 5.0 as a replacement for the earlier Job Scheduler functionality available in NAV 4.0.

The key improvement with Job Queue is that it allows multiple background tasks to be scheduled and executed automatically by NAV, without requiring a logged-in user. These tasks are executed by NAS in the background based on predefined schedules.


What Is Job Queue and What Is NAS?

Job Queue provides a centralized queue where background tasks are defined, scheduled, enabled, or disabled. Using Job Queue, you can control:

  • When a task starts

  • How often it runs

  • Whether it repeats

  • Whether it is active or paused

NAS (Navision Application Server) acts as the execution engine. It continuously monitors the Job Queue and triggers the defined tasks at the scheduled times.

In short:

  • Job Queue = task definition and scheduling

  • NAS = background task execution


Main Components of Job Queue

The Job Queue functionality is supported by the following system tables:

  • Job Queue Setup (Table 470)

  • Job Queue Process (Table 471)

  • Job Queue Entry (Table 472)

  • Job Queue Response (Table 473)

  • Job Queue Log Entry (Table 474)

The most important table is Job Queue Entry (472), which stores the actual job definitions.


Steps to Use Job Queue with NAS

Step 1: Install Microsoft Dynamics NAV Application Server (NAS)

  1. Install the Microsoft Dynamics NAV Application Server.

  2. Ensure the NAS service is correctly registered in NAV.

  3. Configure the NAS Startup Parameter as:

    JOBQUEUE

This tells NAS to process tasks defined in the Job Queue.

Important:
NAS must always run without any user interface. Any GUI-related code must be disabled.


Step 2: Create Job Queue Entries

To schedule a background task, you must create a Job Queue Entry.

Example: Automating “Adjust Cost – Item Entries”

Suppose you want to automate Report 795 – Adjust Cost - Item Entries.

Before scheduling:

  • Make sure the report does not use GUI elements

  • Use GUIALLOWED() checks where required


Step 3: Define Job Details (Job Queue Entry Card)

Open Job Queue Entry Card (Form 673).

In the General tab:

  • Object Type to Run: Report

  • Object ID to Run: 795

  • Earliest Start Date/Time: First execution date and time

This defines what will run and when it can start.


Step 4: Configure Recurrence

In the Recurrence tab, define how often the task should run.

Example 1: Run every 2 minutes between 8:00 AM and 6:00 PM

  • Set recurrence interval to 2 minutes

  • Define start and end times accordingly

Example 2 (NAV 2013):

Run Adjust Cost – Item Entries at 2:00 AM on weekdays only:

  • Set execution time to 2:00 AM

  • Select Monday–Friday

  • Exclude weekends


Step 5: Activate the Job

Once all details are defined:

  • Click Set Status to Ready

This marks the job as active and eligible for execution by NAS.


Step 6: Enable Job Queue Processing

Open Job Queue Setup (Form 670).

  • Ensure Job Queue Active is selected

If you need to temporarily stop all background jobs, simply clear this checkbox.


Summary

The Job Queue combined with NAS allows Microsoft Dynamics NAV to:

  • Run reports and codeunits automatically

  • Execute tasks without user login

  • Schedule recurring background processes reliably

This functionality is essential for automation scenarios such as:

  • Cost adjustments

  • Data synchronization

  • Periodic batch jobs

  • System housekeeping tasks

Understanding Job Queue and NAS is critical when maintaining legacy NAV systems and during upgrades to newer platforms.




How Job Queue and NAS Work Together (Visual Explanation)

The diagram above illustrates how Job Queue and Navision Application Server (NAS) work together in Microsoft Dynamics NAV to execute background tasks automatically, without user interaction.


Step-by-Step Flow Description

1️⃣ Job Definition (Job Queue Entry)

The process begins when a job is defined in the Job Queue Entry table.
Here, you specify:

  • Object Type (Report / Codeunit)

  • Object ID

  • Start date and time

  • Recurrence rules

  • Status (Ready / On Hold)

This defines what should run and when.


2️⃣ Job Queue Setup Validation

The Job Queue Setup determines whether background processing is enabled globally.

  • If Job Queue Active = TRUE, processing continues

  • If disabled, no jobs are executed, even if they are marked as Ready


3️⃣ NAS Monitors the Job Queue

The Navision Application Server (NAS) runs continuously in the background with the startup parameter:

JOBQUEUE

NAS periodically checks the Job Queue for:

  • Jobs marked as Ready

  • Jobs whose Earliest Start Date/Time has been reached

  • Jobs matching the defined recurrence rules


4️⃣ NAS Executes the Job

When a job is due:

  • NAS triggers the specified Report or Codeunit

  • The execution happens without any user interface

  • All GUI-related logic must be suppressed using GUIALLOWED()

This allows NAV to run batch jobs safely in the background.


5️⃣ Job Processing and Logging

During execution:

  • Processing details are written to Job Queue Process

  • Execution results are recorded in Job Queue Log Entry

  • Success, warnings, or errors are logged for review

If an error occurs, the system records the failure and may retry based on configuration.


6️⃣ Recurrence Handling

If the job is recurring:

  • NAS calculates the next run time

  • The Job Queue Entry remains active

  • The cycle repeats automatically

If the job is one-time only:

  • It completes and stops unless reactivated manually


High-Level Summary (One-Glance Understanding)

Job Queue Entry ↓ Job Queue Setup (Active?) ↓ NAS (JOBQUEUE) ↓ Execute Report / Codeunit ↓ Log Results ↓ Next Run (if recurring)

Why This Architecture Matters

This design allows NAV to:

  • Automate heavy processing tasks

  • Run jobs outside business hours

  • Eliminate dependency on logged-in users

  • Centralise scheduling and monitoring

It is especially critical for:

  • Cost adjustment jobs

  • Data synchronisation

  • Period-end processing

  • System maintenance routines


Important Note for Business Central Upgrades

While NAS is specific to classic NAV, understanding this flow is essential when upgrading to Business Central, where similar functionality is handled by:

  • Job Queue Dispatcher

  • Server task scheduler

  • Background sessions



Wednesday, January 9, 2013

xp_ndo_enumusergroups and xp_ndo_enumusersids


Dynamics NAV requires two extended stored procedures from xp_ndo_x64.dll to exist on SQL Server. In the case of these procedures are not found in the SQL Server, you will end up receiving an error message when trying to log on using Windows Authentication:

Here is the solution;
STEP 1:
Manually copy the relevant file from the Product CD to the path given below depending on the Windows version you are running.

C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn

STEP 2:
Run the below scrip file on the SQLQuery Screen. Please note that the below scripts refer to windows 64 bit version. Therefore, if you will be required replace the xp_ndo_x64.dll with xp_ndo.dll


USE master
EXEC sp_addextendedproc xp_ndo_enumusersids, ‘C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xp_ndo_x64.dll’

GO
GRANT EXECUTE
ON [xp_ndo_enumusersids]
TO PUBLIC
GO

USE master
EXEC sp_addextendedproc xp_ndo_enumusergroups, ‘C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xp_ndo_x64.dll’
GO

GRANT EXECUTE
ON [xp_ndo_enumusergroups]
TO PUBLIC
GO

Monday, December 10, 2012

How to kill idle users from NAV server

There are instances where you may be asked to find an easy method for removing the idle users from the NAV database. There has been a well known method where you write a NAV report object to check the idle time of each user and delete the session id by checking their idle time. Then you schedule the NAV report through Navision Application server (NAS).

However, this is an alternative method; in this way, you write a SQL script and schedule it through SQL Job, in the same way you schedule your maintenance plans in your SQL Server such as making daily backups, truncating log files etc.

SQL Script :
USE MyDatabase
 DECLARE @EXECSQL varchar(max)
 SET @EXECSQL = ''select @EXECSQL = @EXECSQL+ 'Kill ' + Convert(varchar, [Connection ID]) + ';'
 From Session WHERE [Application Name]='Microsoft Dynamics NAV Classic client' and [Idle Time]>3000
 EXEC(@EXECSQL)

How to schedule the above SQL Script:
Just enable a job. It’s a matter of pasting the code and give the date & time etc. This is similar to Windows scheduler as well.

Steps for scheduling via a SQL Job:
1.        Expand the SQL Server Agent node and right click the Jobs node in SQL Server Agent and select 'New Job'

2.        In the 'New Job' window enter the name of the job and a description on the 'General' tab.

3.       Select 'Steps' on the left hand side of the window and click 'New' at the bottom.

4.       In the 'Steps' window enter a step name and select the database you want the query to run against.

5.       Paste in the T-SQL command you want to run into the Command window and click 'OK'.

6.       Click on the 'Schedule' menu on the left of the New Job window and enter the schedule information (e.g. daily and a time).

7.       Click 'OK' - and that’s done!!


Special Note: I just thought of posting this into the blog even for own future references. Thanks very much Isuru (Isuru Dias) for letting this to me.

Wednesday, August 29, 2012

REPEATABLEREAD Isolation Level in SQL Server


When you have issues around the table blockings etc, one of the solutions may be to change the database transaction isolation level from ‘SERIALIZABLE transaction isolation level” to “REPEATABLE READ transaction isolation level” This will improve general performance in situations where multiple users are experiencing blocking when they are entering journal entries, sales order entries, purchase order entries and similar tasks.
The following example would give you an idea about the different impacts
Statement 1:
CUSTOMER.LOCKTABLE;
CUSTOMER.SETCURRENTKEY("Document No.", "Line No.");
CUSTOMER.SETRANGE(CUSTOMER."Document No.", '1');
CUSTOMER.SETRANGE(CUSTOMER."Line No.", 1, 10);
IF CUSTOMER.FIND('-') THEN
REPEAT
UNTIL (CUSTOMER.NEXT()=0);

Statement 2:
IF CUSTOMER.FIND('-') THEN
REPEAT
UNTIL (CUSTOMER.NEXT()=0);

With SERIALIZABLE transaction isolation level, all existing records will be locked during the first "REPEAT UNTIL" loop and other users will also be blocked from inserting new records within the specified range. The record that has Document No=2, Line No=1 will also be blocked. This will be main draw back in ‘SERIALIZABLE transaction isolation level”. In other words, the second loop will always read exactly the same result as the first loop.
With REPEATABLE READ transaction isolation level, however there is a potential where someone can theoretically insert a new record within the mentioned range which will then appear as an additional record in the second loop.

You can configure Ms Dynamics NAV to use the REPEATABLEREAD isolation level in SQL Server, by running the following TSQL statement against the SQL database; this will disable the 4194304 flag

update [$ndo$dbproperty] set diagnostics = diagnostics | 4194304

Source : http://blogs.msdn.com/b/nav/archive/2011/05/12/microsoft-dynamics-nav-changes-by-version.aspx

Saturday, December 10, 2011

How to shrink a Navision DB Log file in a SQL 2008 Server

alter database "Demo Database NAV (6-0)" set recovery simple
go

checkpoint
go

alter database "Demo Database NAV (6-0)" set recovery full
go


dbcc shrinkfile ("Demo Database NAV (6-0)_Log" , 1)
go

Monday, November 7, 2011

Navision Code Coverage

The Code Coverage tool differs from the debugger tool that is included in Microsoft Navision. However, the Code Coverage tool contains the same limitations as the debugger tool. You require Granule 7110 (Report & Dataport Designer) to run the Code Coverage tool.

Note If you cannot perform the following procedure, contact your local certified developer partner for help.

To determine the objects and the code that are used during a function, such as posting a sales order, follow these steps:

Step 1:Create a sales order, but do not post it.
Step 2:On the Tools menu, click Debugger, and then click Code Coverage.
Step 3:In the Code Coverage window, click Start.
Step 4:Return to the Sales Order window, and then post the sales order that you created in
step 1.

Step 5:Return to the Code Coverage window, and then click Stop.

Step 6:You see a list of all the objects that were used when the sales order was posted.
On the Tools menu, click Object Designer.
Step 7:Click Codeunit, click Codeunit 1 (ApplicationManagement), and then click Code to open the Code Overview window.

Codeunit 1 (ApplicationManagement) is one of the code units that are listed in the Code Coverage window.

The lines of code that have been run appear as black text. The lines of code that have not been run appear as red text.
In the Code Overview window, the lines of code appear just like the lines of code that appear in the debugger tool. For example, the Code Overview window uses the following formatting:
Bullets appear on each line that contains executable code.
The lines that are marked with a bullet are the only lines in which the information that is displayed is correct.
The lines of code that are not marked with a bullet appear in the same colors as the adjacent lines of code.

To clear the lines that are displayed in the Code Coverage window, click Start. To stop the Code Coverage routine, click Stop.

Note When you run the Code Coverage tool, a large log file may be generated. To reduce the size of the log file, perform steps 1 to 6, and then click Start in the Code Coverage window. After the Code Coverage tool starts, perform step 7.

Business Central SaaS Extension Design: Implementing Plant Tracking with AL Event Subscribers

  Extending Business Central SaaS: Plant Tracking Using AL Extensions  1️⃣ Problem Statement In many manufacturing and service-oriented or...