Sunday, 5 October 2014

How To Solve "There Are No Nav Server On This Database While debugging in Nav 2013"



The above message comes generally if your service is not started or user does not have proper rights etc. I came across with the different kind of situation where user is allowed debugging on the Server, but he is not allowed debugging from client machine where development environment is installed.

This issue is arise due to time on user/client machine is not matching with the time on the server machine.

Scenario 1
Debugging the object on the server - In this scenario user can able to debug the objects.


Run the development environment and run the debug Session


When you run the debug session it opens the screen and create a session ID as below

Now go to the File->Database->Information



You will find the Database Information Screen which gives the details about Server, Database, and Server Instance etc. Click on the server instance and check the Server instance information




Go to the table filter and check the filter given



The filter is on a Server Instance Table for
  • Status - Started
  • Server Port - <>0
  • Server Instance Name <>''
  • Server Computer Name <>''
  • Last Active Time > Server Time which is saved 
 Navision saves the time of a server where your Sql Server (Database) is installed.

After zooming the record following are the details saved by navision





Scenario 2
Debugging of the objects from different Machine/Client where Client Machine Time is ahead of Server Time- In this scenario user will not able to debug the objects.

In this scenario, Please make sure that your client machine time is ahead of Server Time.

Now go to the File->Database->Information in development environment.

If you click on the Server Instance you will not find any details


If you check the Filter 

It shows that current time of client machine should be greater than of Last active time stored. Though client machine's current time is more than the server time still it will not allow you to debug the code.
But if you keep client machine time behind the server time then Navision will allowed debugging the code.

It indicates that Navision select the Sql server Machine's Time as last active time.
In the above screen shot, the time shows is a server time. 

It means

  • If the client machine time (Navision Developer machine) is equal to Server Machine Time, Navision will allowed user to debug the code.
  • If the client machine time (Navision Developer machine) is less than Server Machine Time, Navision will allowed user to debug the code.
  • If the client machine time (Navision Developer machine) is more than Server Machine Time, Navision will Not allowed user to debug the code. 

Tuesday, 12 August 2014

How To Use Dimension Combination in Navision?

What is Dimension Combination
To avoid posting entries with contradictory or irrelevant dimensions, you can block or limit specific combinations of two dimensions. A blocked dimension combination means that you cannot post both dimensions on the same entry regardless of what the dimension values are. A limited dimension combination lets you post both dimensions to the same entry, but only for certain combinations of dimension values.

Where to Use
In an organization, If one cost center(Dimension/Dimension Value) could not go along with another cost center(Dimension/Dimension Value) there you can use concept of dimension combination of Navision. 

For e.g. A company is manufacturing pickles in Units of Maharashtra. Uteran unit of the company does not have the capacity and skill of producing Jack-fruit Pickle. So its obvious that there will not be any Expenses,Purchase or Production will be possible on that  unit . Following are the Units and Product Group dimensions.

Units -

















Product Groups -



In the above 2 dimension To avoid this combination, User can go to Dimension Combination to do the Setup.

Step 1
Go to the Dimension Combination


Step 2
Open Dimension Combination and filter it for Units & Product Group















Step 3
Click on the button of Product group and Select the option Limited.


If you select the option blocked, then user can not use Productgroup dimension with Units. If you select Limited then User can mention a combination of the dimension from both Productgroup and Units for blocking.




Step 4
Right click on the button and select the drill down option

Step 5
Select the unit Uteran





















Go to the right for selecting Product Group Jackfruit Pickle

Select the option Blocked


Now Navision will not allow to post any transaction having combination of Unit-Uteran and Product Group - Jackfruit Pickle


To test the above scenario, we will try to post the data in Item journal for the above combination


While Posting the data, Navision will throw a following error


If you select the different combination, Navision will post the data.

Wednesday, 9 July 2014

How to Use Chart Components in NAV 2013

Navision had given a facility to use Chart object. Where user can drilled down and navigate till the document level.We can take one example where user can see the overall profit in the graphical format.

For getting profit we need to create 2 Analysis Views which are updatable.
  •           Revenue
  •           Expenses
Note : User must select the proper set of accounts for Revenue and Expenses

Following are the steps to create a Chart

1. Create a Page(Profit Chart) which includes Business Chart Buffer as a source table



















2. Select the Field Business Chart


3.  Create a separate code unit for Updating and Calling the Chart

4. Following Functions Needs to be created in Code Unit
    a.  UpdateDataPL – Updating the data for Actual Revenue/Expense Profit


In the above example Initialize, SetAxis, AddColumn, SetValueByIndex are the functions of Business Chart Buffer Table. A separate Table(In This Case Job Profitablity Setup Table) and Field is used to calculate The Total Revenue and Total Expense as a flow field which is pointed to Revenue & Expense Analysis View entries.

    b.  DrillDownRevenue – Use this function for Drilling down to The Analysis View Entry Revenue



    c.  DrillDownExpense – Use this function for Drilling down to The Analysis View Entry Expense



5. All the above functions needs to call from Profit Chart Page.
6. Create a separate Function Called UpdateChart on Page. This function needs to call on OnfindRecord Event on Page.



7. We need to write a code on Datapointclicked event of the page for drilled down to the transaction level

8. Now you can attach this page to role center. Before calling the page please make sure there is a record for user id must be available in the setup table. If the user is not available then please create a user. ( In the above scenario Job Profitability Setup table which has been used which is a customized table. Useid,Revenue(FlowField),Expenses(Flowfield) are the three required fields has been taken from that table. Revenue field consist sum amount from the Analysis Entry Table for the Analysis View "Revenue". Expense field consist sum amount from the Analysis Entry Table for the Analysis View "Expenses".)





Wednesday, 2 July 2014

Prevent Negative Inventory


Many years various clients asking for the functionality of preventing Negative entry which has been provided by Microsoft in Nav 2013 R2. This provision has been given by Microsoft in Inventory Setup.


If the Prevent Negative Inventory setup is marked at Inventory Setup then, Inventory has been checked for all Items.
If the Prevent Negative Inventory setup is not marked at Inventory Setup then, In Item Master there is field called Prevent Negative Inventory needs to be checked. In this scenario, The Inventory will get checked for those Items which are marked with Prevent Negative Inventory


In Standard Navision, I observed that This Functionality is only worked for Sales. But when I tried to post with Item journal and entry type is “Negative Adjt.”. The entry get posted with negative Inventory. To prevent user from posting negative Inventory, I have done a small change in the function written in Item Ledger Entry Table Called “VerifyOnInventory”

Old Code
IF NOT Open THEN
  EXIT;
IF Quantity >= 0 THEN
  EXIT;
CASE "Entry Type" OF
  "Entry Type"::"Negative Adjmt.","Entry Type"::Consumption,"Entry Type"::"Assembly Consumption":
    IF "Source Type" = "Source Type"::Item THEN
      ERROR(IsNotOnInventoryErr,"Item No.");
  "Entry Type"::Transfer:
    ERROR(IsNotOnInventoryErr,"Item No.");
  ELSE BEGIN
    Item.GET("Item No.");
    IF Item.PreventNegativeInventory THEN
      ERROR(IsNotOnInventoryErr,"Item No.");
  END;
END;


New Code
IF NOT Open THEN
  EXIT;
IF Quantity >= 0 THEN
  EXIT;
CASE "Entry Type" OF
  "Entry Type"::"Negative Adjmt.","Entry Type"::Consumption,"Entry Type"::"Assembly Consumption":
  //AK Start
  //IF "Source Type" = "Source Type"::Item THEN
  //      ERROR(IsNotOnInventoryErr,"Item No.");
    IF ("Source Type" = "Source Type"::Item) OR ("Source Type" = "Source Type"::" ") THEN
      ERROR(IsNotOnInventoryErr,"Item No.");
  //AK End

  "Entry Type"::Transfer:
    ERROR(IsNotOnInventoryErr,"Item No.");
  ELSE BEGIN
    Item.GET("Item No.");
    IF Item.PreventNegativeInventory THEN
      ERROR(IsNotOnInventoryErr,"Item No.");
  END;
END;

Friday, 27 June 2014

How To Handle No of Users And Allotment of time to particular user in Nav 2013

I have come across with one interesting point for handling no of Users and Allotment of time to particular user in Nav 2013. Let’s take one scenario where No of user license in Nav is 30, and actual users in the organization are around 48.

Out of these 48 users are divided into 4 Parts (Finance,Sales,Purchase,Warehouse). Out of These users, Finance Users  are continuously connected to the database. Sales Users and Purchase Users are generally connected in the afternoon and warehouse is connected generally in the evening. 

In this case, we can create multiple NST (Navision Service Tier) Department wise. Each NST is attached to domain and a Port. In active directory services, system administrator can allot time to open a particular port for a particular time for a particular user. In navision there is no facility for controlling the time line of user but we can control it thru ADS (Active Directory Services) And Firewall.

If you have create multiple NST, Performance wise as well as from the point of debugging it will be very useful.


Multiple Active Resultsets (MARS) In Nav 2013

There are lot of things get changed from Nav 2009 R2 to Nav 2013. Microsoft Dynamics Nav Server has been Re-written by Microsoft to use ADO.dotnet instead of ODBC.

The New interface managed data access layer of Sql Server. Which decrease the consumption of the memory. It also make the 3 box installation very easy by simplifying Sql Server Connection Pooling.

There has been no more one to one connection between Nav client and Sql Server Connection. Previously each connection consumes 40 MB of Memory. Now Memory allocation is in Managed Manner which is more efficient. For. eg If the users are connected to one nav server Instance where one user read a record, a second user can read the record from same cache. This cache is called as Data Cache. There are 2 types of Data Cache Global and Private. Global Cache is for all users connected to a Microsoft Dynamics NAV Server instance and Private cache is per user, per company, in a transaction scope. Data in a private cache for a given table and company are flushed when a transaction ends.

(It means, for better performance the memory should be good where the Navision Service Tier lies.)

Microsoft Dynamics Nav 2013 no longer uses server cursors to retrieve records. Now records are retrieved using MARS (Multiple Active Result sets). In Nav 2013 the option for Record Set Property is no longer exist.