Search This Blog

Number Series for Production Orders in Navision

In the demo company from Microsoft (also known as Cronus) the Manufacturing Setup has been configured to use different number series for the different production order statuses. Configuring it this way make Dynamics NAV to assign a new production order number each time the status is changed (except when it is changed to finished). I have never understood why you would setup the system this way, and I have never meet a customer that wants the system to behave this way either. But, I have seen it being implement this way several times. It may makes sense to use a different number series for simulated production orders, but not for firm planned vs. released production orders in my mind.

The preferred way to set this up is to use the same number series for all of the statuses, this way a firm planned production order will have the same order number when it is released (which in my mind is a lot less confusing).

This is how is should look like if you ask me, all the statuses has the same number series;


Note: you have a similar case for invoices and credit memos in the sales and purchase modules, You can setup the same number series for both unposted and posted invoices (and credit memos) in the sales & receivables and purchase & payables setup tables. This way the posted invoice (or credit memo) will have the same number as the unposted one.

Debugger Break Rules – Break on Records Changes (Insert, Modify or Delete) in Navision

I was debugging something today and I noticed the ‘Break on Records Changes’ break rule, sweet… 🙂 I didn’t know this. In the older versions of Dynamics NAV I always used the code coverage to find where in the code records are modified, but this is much better.


Here is how to do it; start the debugger, click ‘Break Rules’, and activate the ‘Break on Records Changes’. The debugger will now stop whenever a record is inserted, modified or deleted.


Mandatory Dimensions by Account Type in Navision

Dimensions are great in Dynamics NAV and one of the things that makes it great is that you can control the required dimensions for each type of posting into the general ledger by setting dimensions as mandatory on the general ledger accounts. Most people that work with Dynamics NAV knows this. But surprisingly many people does not know that you can also specify what dimensions that are mandatory for each account type by using the ‘Account Type Default Dimension’ setup.


For each of your dimensions you can go to the ‘Account Type Default Dim’ and setup if the dimension is mandatory for all transactions with a certain type. As an example, the below setup defines that the ‘CUSTOMERGROUP’ dimension is mandatory for all Customers (table 18). This way you will not be able to post anything without this dimension against any of the customers independent on what is setup to be required on the general ledger accounts.


Run Dynamics Navision as Different User (NAV Login with multiple users on a single Machine)

A question that I receive frequently is; ‘how do I run Dynamics NAV as a different user?’. A basic question it seems, but not everybody is aware of how it can be done.

It could for example be that you are testing permissions and you want to run one client with SUPER user access to do the permission setup and another client with limited access to test the setup at the same time. Another common scenario is that you want to debug something on a users computer and for this you need your own log-in to have full permission and access to the debugger.

Luckily it is quite easy to run Dynamics NAV as a different user without logging out of windows, here is how to do it:

Right click on the Dynamics NAV icon and select Run as Different User.

Note :- If the option does not show up when you right click, try to hold down the SHIFT key while right clicking.



Then you simply sign in with the different user through the dialog that appears and that’s it!
Now you can run two or more NAV clients on the same computer logged in as two or more different users.

Nice, easy and very useful! 🙂

How to Calculate the Current Fiscal Year in Navision C/AL

In Navision, there’s no function that will give you the fiscal year according to what you’ve setup on the Accounting Period table. Here’s a code that will get the current fiscal year based on the accounting period:

AccountingPeriod is a record variable  to table 50
Date1 and Date2 are date variables

AccountingPeriod.RESET;
AccountingPeriod.SETRANGE(“New Fiscal Year”,TRUE);
AccountingPeriod.”Starting Date” := WORKDATE;
AccountingPeriod.FIND(‘=<‘);
Date1 := AccountingPeriod.”Starting Date”;
IF AccountingPeriod.NEXT = 0 THEN
  Date2 := 12319999D
ELSE
  Date2 := AccountingPeriod.”Starting Date” – 1;

Sort on Multiple Columns in Dynamics NAV

This is something I first discovered some months ago, and back then I didn’t think that much about it. Recently someone asked me if it was possible, and I thought it would be worth a quick small blog post.

Yes, you can sort on multiple columns in Microsoft Dynamics NAV (with some limitations though). You do it by holding the shift key down while clicking the next column(s). This way Dynamics NAV sorts the data based on multiple columns.

On the page you can see it by the sorting indicator (or whatever the small triangle is called) is being displayed on multiple columns.


The only odd thing is that it does not seem to work to decide if the sorting is going to be descending or ascending on the individual columns, they are either all descending or all ascending. Well, you can’t get everything. 🙂

Restarting Job Queue automatically when it Hits an Error on Dynamics Navision

Job Queue 

In Dynamics Navision, you can setup job queue to automate processing of tasks. Popular tasks that are automated are things such as Adjust Cost – Validating Entries, Batch Job processing, Reporting, etc.

Setting up job queue in Navision couldn’t be much easier. BUT..

The Problem

When the job queue runs into an error, it will never get picked up again. This means that while the Job Queue is an automated process, the IT manager will need to monitor this every day to make sure every process is running.

I know what you’re thinking, “This does not make sense!”. I fully agree.

There are some processes where the error is fatal. This is the reason why you would not want to have it run again. However, there are some situations where the error occurs when the table is locked by another process, in this case, you absolutely need to have it restart again.

This is especially true when you process EDI orders. You have to send back acknowledgment and/or confirmation within a certain timeframe or else you’ll get charge backs. Having the job queue error out because of table locks does not make too much sense.

The Solution 

The problem lies in the Job Queue Dispatcher codeunit (448). If you go down and find the local function GetNextRequest, you’ll see that for some odd reason, the process is only looking at any statuses that are Ready.



So we will need to modify the code to scan for the error entries as well.



Depending on what you use the Job Queue for, I would include job queues that are In Process. The reason is if it’s running and someone stops the job queue, it’ll stay stuck in the In Process status.

By setting this, it’s important that you set the Max No. of Attempts. You don’t want the job queue to keep running if there really is a critical error.