Friday 22 April 2016

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.

Friday 15 April 2016

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.