metadata in Dynamics NAV

A set of data that describes and gives information about other data.

In NAV,
if the object is compiled, a metadata will be specified.

We need metadata because, its used on NAV Server to allow running and debugging the object.


Ex:
If you have a table 18 customer, a record will be created for that when you compile it,



  • If the record(metadata) is missing for an object, then you cannot run object on NAV server.
  • when you compile an object in development environment. Record(metadata) is automatically generated.

Metadata field, Object metadata table.

Specifies XML metadata for the object. This allows the object to be run on Dynamics NAV Server.



  • Metadata is stored in Table 2000000071 object metadata for all navision objects whether it is visible or hidden. 
  • usually system table "Object Metadata" is created when we restore the database after creating the keys for various tables while processing the objects.
  • For visible objects these metadata's are automatically created when we compile the particular object. 

How to reduce Impact on Server and Network traffic.

To reduce impact on server :

1. COMMIT Function : Usually they're automatically handled by database. So avoid using it as much as possible.

2. LOCKTABLE Function : During inserting, modifying, renaming and deleting a data in a table. The SQL Server will automatically locks the table. So, avoid using it.

Example :

Consider a Customer table-

Developer A will check the cost between 10,000 to 50,000. If necessary he 'll modify some value.

If Developer B is also working on same database and same Customer table, modifying the value by Developer B will also affect the changes of Developer A. So, Developer A will lock the table while working or retrieving any value from table.

But, since SQL Server will lock the table automatically when you try to modify the data. Hence, avoid using LOCKTABLE function.



3. Don't examine(or verify) return values of insert, modify, delete function, If it is examined server must be notified.

4. Avoid Roundtrips to the servers.
Round trips - A round trip consists of a request sent to the server for data or an action (whenever a call to insert/modify/delete trigger for an action it takes time and resources which impacts on server.

4. Use CALCSUMS and CALCFIELDS function - Use it whenever you get a chance, to avoid examining records to total values.

5. Use SETAUTOCALCFIELDS function - Whenever you need to obtain value of flowfield for every single row in loop.


To reduce Network Traffic :

1. Apply keys and filters, and use MODIFYALL and DELETEALL functions instead of using modify and delete for each record.

2. To perform calculation on server fields that have single function call, use CALCSUMS and CALCFIELDS (both will take multiple parameters)


Extended stored procedure error (xp_ndo.dll and xp_ndo_x64.dll) in NAV 2009

Ever you faced a problem when you try to open the NAV 2009 database which says,

"The extended stored procedure xp_ndo_enumusersids in the library file xp_ndo.dll, is not available on the <server name> server."

Well, if you've faced this above error then the solution for that is very simple. :)
Firstly identify where are those dll files and copy that to your local machine.

You can find xp_ndo.dll and xp_ndo_x64.dll in the following path of NAV 2009 R2 installation folder.
D:\2009R2\SQLDatabase\PFiles\Microsoft Dynamics NAV\60\Database\Cronus.flf


Once you copy the above .dll files in your local folder. Open SQL Server and go to,

Databases -> System Databases -> Master -> Programmability -> Extended stored procedures,

1. Create a new Extended stored procedure in that,

Give a stored procedure name as xp_ndo_enumuserids
and DLL path (the path you the .dll file) - xp_ndo.dll  (This dll file is 32 bit)

Go to permission click search and choose public.
Selecte Execute, Grantor - dbo and tick mark Grant.

2. Again, Create a new Extended stored procedure, go to properties in that,

Give a stored procedure name as xp_ndo_enumusergroups
and DLL path(the path you the .dll file) - xp_ndo_x64.dll  (This dll file is 64 bit)

Go to permission click search and choose public.
Selecte Execute, Grantor - dbo and tick mark Grant.

Fig. below explains in detail.

Once you are done with this go back to your NAV. Try to open the database of 2009R2 and you will be good to go further with your work.


Provider ID Property in Dynamics NAV

You can find this property in "Part" type of the container in Page.

It is applied on a factbox/subpage to establish a link between subpage and the factbox, so that when record changes in subpage, factbox is also updated.

Example..

Consider a document page called Seminar Registration Invoice.




The control id of the part which has linked to "Seminar Reg. Subform"(A listpart page) must be given as a provider id in the factbox(in provider id property of  Seminar Details Factbox ).

So when every you go to next record, the changes will be even affected in Seminar Details Factbox.

This is a very interesting property because there's a link from a repeater or any other controls to a Factbox.

To fix the Mulitple Client issue which is opening for Each run of object

Ever you installed NAV 2016 and if you've faced this problem i.e NAV RTC opens multiple client for each run of object. Then here is a two step solution to solve your problem.

1. Run the command prompt as administrator.
2. Write the following command in your command prompt

C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /register "C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Client.WinForms.dll" /tlb


key points to be noted:

RegAsm - RegAsm is an Assembly Registration Tool that reads the metadata within an assembly and adds the necessary entries to the registry which allows clients to create .NET framework classes transparently.

tlb(type library file) - Its a file extension for object linking and embedding(OLE) type library file format used by Microsoft Visual C++ software development program.

dll - dynamic link library - Its a microsoft implementation of the shared library concept.
A dll file contains code and data that can be used by multiple programs at the same time, it promotes code reuse and modularization. 


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

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.



2026 Release Wave 1(28.0) Major Update in Business Central That Actually Help Clients

This release is not about “new screens.”  It’s about running the business with fewer surprises and more confidence. 1. Smarter Work with C...