Wednesday, 2 March 2016

NAVY <---- NAVX (Enhancement of Extensions in Dynamics NAV 2016)

There're already lot of blogs that explains about NAVX (Using extensions and events in dynamics NAV without affecting the source code).

This NAVX package will create a new layer on top of NAV I mean it will show the customizations we have done for addons only in SQL server but not in Client of NAV. This is something interesting I found while I was trying to upgrade one of the addons from 2015 to 2016 using a new concept called Extensions in NAV 2016.

But, the upgradation using Extensions didn't make me surprise because I found few things which will not upgrade using this tool.

1. Standard codeunits cannot be modified
2. Reports cannot be upgraded using extensions
3. No customizations can be done on extensions

(If we need to customize again we need to uninstall the NAVX modify the object set in NAV and then install NAVX again, This is something not userfriendly and is not much appreciated.
But, for every problem there's a solution.

Microsoft has came with a new package called NAVY(An enhancement of NAVX).

This NAVY is a package manager for NAV 2015 and NAV 2016. But as of now it has been tested only in NAV 2016.

The features that is included in NAVY are:

You can install, uninstall, suspend, restore or you can even build a NAVY package.


This is something new you can see in NAVY than you saw in NAVX.

Yes, its suspend and restore.

As I said earlier, In NAVX if you need to customize any objects you must uninstall the NAVX package go back to NAV and modify which is risky and time consuming.

But, In NAVY you can suspend a package for sometime which will save the field values in a special tables by removing the  changes from standard objects.

Same way the restore command will installs the changes to standard objects and will restore the field values.

There is already a prerelease software which has been released for our learning purpose but it is still not left anywhere for acual use.

You can install a package to a database,

NAVY install Name=<packagename> DatabaseName=<databasename>
You can download the NAVY prerelease software in my dropbox. Click here to download NAVY

Tuesday, 15 December 2015

How to run NAV 2015 and NAV 2016 Administration tool side by side

Everyone would have installed NAV 2016 and would have faced the same problem, i.e, you couldn't able to run NAV 2015 administration tool if you have installed NAV 2016



One way to use the services of NAV is using powershell. But, many people might not be familiar with commands of power shell.

So, its better go first identify where is the problem and what's the solution for a problem.

The problem is mainly because of registry key. NAV 2015 and NAV 2016 is pointing to the same registry key in registry editor.


If you go to the following path “C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft Dynamics NAV Server.msc” and open Services.msc using notepad as shown below both NAV 2015 and NAV 2016 will point to same key,




There are 2 ways to fix this above problem,

1.
  • Download the registry file
  • You can download the registry file here in my dropbox in the below link,
        https://www.dropbox.com/s/b0thyq7pm8mfb06/2015%20reg%20file.reg?dl=0



2. Or else you can follow the steps manually by exporting the registry file by searching for a key “BA484C42” in registry editor and editing the exported registry file as shown below.






a. Replace all occurrence of key “BA484C42” with “BA484C41”

b. Change the path of “C:\\Program Files (x86)\\Microsoft Dynamics NAV\\90\\RoleTailored Client” to “C:\\Program Files (x86)\\Microsoft Dynamics  NAV\\80\\RoleTailored Client”

c.Modify the “Version=9.0.0.0” to “Version=8.0.0.0”

a
  • Once you are done with any one of the above 2 steps, import the registry file into your registry editor.



Follow the path as shown below and open the services.msc as administrator in your notepad

C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft Dynamics NAV Server.msc


Change the keys from
 BA484C42-ED9A-4bc1-925F-23E64E686FCE 
to BA484C41-ED9A-4bc1-925F-23E64E686FCE as shown in the fig. below.



After the changes are updated for all occurrence of  key you can save the file and now you can run NAV 2015 and NAV 2016 administration tool side by side as shown in below fig.



Sunday, 8 November 2015

Cumulative Updates from NAV

As we all know, Microsoft will be releasing new cumulative updates often to fix various bugs in NAV. So, again there's a release of new Cumulative updates in NAV.

In NAV 2016, CU1 - Build 43402 has been released.

In NAV 2015, CU13 Build - 43389 has been released.

In NAV 2013, R2 CU25 Build - 43391 has been released.

In NAV 2013, CU32 Build - 43390 has been released.

Thursday, 5 November 2015

Virtual tables, Temporary tables, System tables

Virtual tables : They're created by the system at runtime. The tables are read-only, information present in these tables cannot be changed.

It do not store physical information in database.

You cannot insert, modify, delete information in virtual tables.

You cannot view the virtual table or run it from table object designer. But, however you can create a page with source table view property as any virtual table name and run it.

Example:

Consider a date virtual table, Its existence is virtual not visible in object designer. But when we create a page with source table view as "Date" table. We can see the values of Date virtual table in role centered page.

fig. below explains the virtual table in detail.

Create a page with a name 'Date virtual list' and give a source table view as "Date".


when you run the above page you can see the following data's inside the "Date table"





Temporary Tables: (Memory-based table)

They're not physical tables in database. All interaction in a table occurs in memory on service tier.

We make tables as temporary tables so that the processing will be fast. There will be no load on SQL server and network service. It is same as normal tables but the information will be lost once the table is closed.

Commit doesn't affect any temporary tables and error doesn't roll back any changes to temporary tables.

fig. below explains in detail on how to make a table as temporary table.




go to any table designer and  Go to view -> C/AL Globals. Choose a variable with record type and select any table.

Shift+f4 or select properties and make temporary table as 'yes' as shown in fig. below.





System Tables:

We can see the system tables in object designer just like normal table. But, system tables are created automatically whenever we create a database.

When you click on File -> Database -> New

The following dialog will appear,


When you click ok you can see System tables. Fig. shows various system tables present in database.





These tables will be present in each and every database to track system related information like checking active session, setting up permission, check user. You can modify, add/delete data in these tables.


System Tables:

They store physical information in database. Created automatically by NAV.
You can customize, read, write, change, insert, delete information contained in them.
* Security Permission
* Permission Set



Wednesday, 4 November 2015

Difference between page actions and control actions

This is a very simple approach but most of the beginners get confused on these things often while designing page.

If we go to any container with cuegroup. We can see in "View" toolbar -  page actions and control actions.

Always, page actions and control actions behave same at the last line( 1st empty line).
However,

Page Actions:

  • page actions can be seen when you navigate through different areas as shown below.



The design of page is simple select any page and go to design -> view -> page actions as shown below.



Control Actions:

  • Control actions can be seen on role-centered page. 
  • Control actions appear only in Cue group as shown in screenshot below.




    You can view the design of control action by selecting the cuegroup and choosing the control actions in -> view -> control actions.

    fig. below would express the design in a better way.


    As shown in the fig. below go to design of Cuegroup page, select the cuegroup, go to view tab and select control actions. You can see the control actions defined here.



    Friday, 30 October 2015

    Difference between For loop, While loop and Repeat-until loop

    Technically its very important to know when to use for, while and repeat-until loop while we are coding based on the requirement. Since all the 3 loops are used to perform incremental task. Developers must be properly knowing when to use For loop, while loop and repeat-until loop.

    So, the major reason between these three loops is:

    1. For loop:

    For loop is used if we know the number of times the statement needs to be executed.

    FOR var := 1 TO 5 DO

    BEGIN
     //statement
    END;

    output:

    //statement
    //statement
    //statement
    //statement
    //statement

    In this case the statement is executed 5 times.

    2. While loop:

    While loop will not execute if the condition is false.

    var := 0;

    WHILE var <> 0 DO BEGIN
      var := var - 1;
     //statement
    END;

    output:

    In this case the condition is failed. So while loop never gets executed.


    3. Repeat-Until loop:

    var := 0;

    REPEAT
      var := var - 1;
      //statement
    UNTIL var <> 0;

    Output:

    //statement

    In this case as you see whether the condition is true/false but the statement is executed at least once.




    Difference between Upload and Change in License Information

    Usually we will be working on different add-ons and we also update the license depending upon the add-ons of different customer.

    As we all know, We update the license by going to NAV IDE, Tools - > License Information.
    In License Information window we see 3 tabs Upload, Change and Help.

    Everyone will often get confused between choosing Upload / Change while updating the license information. So, its better to know the difference before messing up with assumption.

    When you choose Upload, the license will get loads into Master database of SQL Server. Whenever  you open any NAV database of the server you are working on it will use the same license.

    When you choose Change, the license gets loaded for active session only. When ever you close the current session and open a new client. It will be restored with its earlier license.