Thursday, April 28, 2011

How Do I Manually Register Type Libraries, DLLs / ActiveX Controls, and ActiveX Servers?

The following commands may be needed in the case of installing multiple NAV Service Tiers in single Server. For example, when you are in need of installing NAV 2009 SP1 and NAV 2009 R2 in the same server, the second instance needs to be installed and registered in the Windows Registry using below commands

Problem:
How do I manually register type libraries (.tlb), ActiveX controls (.ocx), and ActiveX servers

Solution:

Type Libraries
Type libraries are binary files that contain all type information needed to utilize procedures and classes in a DLL. To register a type library, you can use regtlib.exe as follows:
1. Select Start » Run.
2. Type the following in the dialog box that appears:
C:\WINDOWS\system32\URTTemp\regtlib.exe
Where is the location of your type library file.

ActiveX Controls

ActiveX controls are files with a .ocx extension. These controls come in 16-bit as well as 32-bit forms, with 32-bit being the most predominant. To register an ActiveX control, you can use regsvr32.exe as follows:

1. Select Start » Run.
2. Type the following in the dialog box that appears:

regsvr32 This could also be a OCX file

Where is the location of your ActiveX control.

If you have a 16-bit control, you can run regsvr instead of regsvr32. If your ActiveX control is registered incorrectly, you must first unregister it and then register it again. In both cases, you will get a dialog box prompting you that your control has been unregistered or registered successfully. To unregister a control, use the switch /u (i.e., regsvr32 /u ).

Note: For a complete listing of the switches available, just type regsvr32 from the Start » Run dialog box.

ActiveX Servers

ActiveX servers can be in the form of both DLLs and executables (EXEs). DLLs can be registered similar to an ActiveX control (e.g., regsvr32 C:\Teststand\BIN\TEAPI.DLL). However, when registering an EXE, you must use the switch /RegServer as follows:
1. Select Start » Run.
2. Type the following in the dialog box that appears:
/RegServer

Where is the location of your EXE server (e.g., C:\TestStand\Bin\REngine.exe /RegServer).

In the same manner, to unregister an EXE ActiveX Server use the switch /UnRegServer (e.g., C:\TestStand\Bin\REngine.exe /UnRegServer). RegServer and UnRegServer are switches whose functionality is built into the executable.

Note: If you find that you are dealing extensively with Type Libraries, ActiveX Controls, and ActiveX Servers, you may find the utility linked below useful. It is a very simple utility that allows you to quickly register and unregister Type Libraries, ActiveX Controls, and ActiveX Servers. The application is distributed freely by the Common Controls Replacement Project (CCRP), and the readme file included with the application explains how to use it. Also refer to KB 2XDAB1SJ for more inofrmation about .ocx files.

You may also try below commands in the case of an eror in the above commands for registering required DLL files,

Examples:

c:\Windows\system32>
gacutil/i "C:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Dynamics Online Payment Client\Microsoft.Dynamics.NAV.DO.ClientProxyWrapper.dll"

C:\windows\microsoft.net\framework\v4.0.30319\regasm /codebase /tlb:Microsoft.Navision.Mail.tlb Microsoft.Navision.Mail.dll

c:\windows\microsoft.net\framework\v2.0.50727\regasm /unregister /tlb:microsoft.navision.mail.tlb microsoft.navision.mail.dll

C:\windows\microsoft.net\framework\v2.0.50727\regasm /codebase /tlb:Microsoft.Navision.Mail.tlb Microsoft.Navision.Mail.dll

Saturday, March 12, 2011

Creating SQL Server VIEWs to show the Ledger Entry Table values including Flow fields

I am using two examples to explain the logical background in regard to retrieving values of the Flow Fields.

Example 1 – SQL View for Customer Table

In Customer (No 18 of Dynamics NAV DB) Table, ‘Balance’ and the ‘Balance LCY’ fields have been defined as Flow Field, therefore during the run time it will pull records from the Detail Customer Ledger Entry table (No 379 of Dynamic NAV DB ) to show the ‘Balance’ and ‘Balance LCY’ on the Customer Card. When you create a SQL view for customer table, you will also have to apply the same principle. In other words, you have to join ‘Detail Customer Ledger Entry’ with Customer table to retrieve the corresponding values.

USE [Demo Database NAV (6-0)]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[View_Customer]
AS
SELECT TOP (100) PERCENT dbo.[CRONUS Australia Pty_ Ltd_$Customer].No_, dbo.[CRONUS Australia Pty_ Ltd_$Customer].Name,
SUM(dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry].Amount) AS AMOUNT,
SUM(dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry].[Amount (LCY)]) AS AMOUNT_LCY
FROM dbo.[CRONUS Australia Pty_ Ltd_$Customer] LEFT OUTER JOIN
dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry] ON
dbo.[CRONUS Australia Pty_ Ltd_$Customer].No_ = dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry].[Customer No_]
GROUP BY dbo.[CRONUS Australia Pty_ Ltd_$Customer].No_, dbo.[CRONUS Australia Pty_ Ltd_$Customer].Name
ORDER BY dbo.[CRONUS Australia Pty_ Ltd_$Customer].No_

GO

Please note that I am using Dynamics NAV 2009 SP1 Asutralian & New Zealand version for my examples. Therefore when you test this example, you may be required to replace the compnay name ‘CRONUS Australia Pty_ Ltd’ with ‘CRONUS International Pvt Ltd.’ As appropriately. Further if you’re testing this scripts with a different database file, instead of ‘Demo Database NAV (6-0’, please replace the database name correctly.

 
Example 2 – SQL View for Customer Ledger Entry Table

In the second example, I am creating a SQL view for Customer Ledger Entry Table. Again, you know that ‘Amount’ and ‘Remaining Amount’ are defined as Flow Fields by placing a look up to the Detail Customer Ledger Entry Table. Therefore in the SQL View definition, you would notice that a JOIN command is used to establish the link between the Customer r Ledger Entry (18) & Detail Customer Ledger Entry Table (379). More importantly, JOIN command has been used for two times in order for calculating ‘Amount’ and ‘Remanning Amount’ respectively. In the first case, Detail Customer Leger Entry is joined only based on the Customer Ledger Entry No. field, whereas in the second case Detail Customer Leger Entry is joined based on both Entry No & Entry Type fields.

USE [Demo Database NAV (6-0)]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[View_Cust_LedgerEntry]
AS
SELECT dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Entry No_], dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Customer No_],
dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Posting Date], dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Document Type],
dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Document No_], dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].Description,
SUM(dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry].Amount) AS Amount, SUM([CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry_1].Amount)
AS Remaning_Amount


FROM dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry] LEFT OUTER JOIN
dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry] ON
dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Entry No_] = dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry].[Cust_ Ledger Entry No_] AND
dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry].[Entry Type] = 1 LEFT OUTER JOIN
dbo.[CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry] AS [CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry_1] ON
dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Entry No_] = [CRONUS Australia Pty_ Ltd_$Detailed Cust_ Ledg_ Entry_1].[Cust_ Ledger Entry No_]


GROUP BY dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Entry No_], dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Customer No_],
dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Posting Date], dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Document Type],
dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].[Document No_], dbo.[CRONUS Australia Pty_ Ltd_$Cust_ Ledger Entry].Description

GO

When you need to create SQL views for other ledger entry tables, you will have to follow the same principles as explained above. For example, in the case of creating a SQL view for Item or Item Ledger Entry Tables, you will have to link either ‘Item Leger Entry’ or ‘Value Entry’ or both as appropriately depending on the required fields available in the SQL view.

Sunday, February 13, 2011

More Training Titles Released for Microsoft Dynamics NAV 2009

Brand new training titles have been released and are available on PartnerSource and CustomerSource (account required). The trainings are available as downloads and as instructor-led training (ILT).

Upgrading Microsoft Dynamics NAV 2009 Native Database to Microsoft SQL Server

This training is designed for individuals preparing to upgrade Microsoft Dynamics NAV 2009 Native database to Microsoft SQL Server. This training covers the upgrade process from preparing existing data, configuring Microsoft SQL Server, troubleshooting data issues, to validating data after upgrade.

PartnerSource: https://mbs.microsoft.com/partnersource/communities/training/trainingmaterials/student/course80298.htm?printpage=false

CustomerSource: https://mbs.microsoft.com/customersource/training/trainingmaterials/student/course80298.htm?printpage=false

Microsoft Learning: http://www.microsoft.com/learning/en/us/Course.aspx?ID=80298A&Locale=en-us

Microsoft SharePoint Technologies and Microsoft Dynamics NAV 2009

This training is designed for individuals who want to integrate Microsoft Dynamics NAV 2009 with Microsoft SharePoint technologies.

PartnerSource: https://mbs.microsoft.com/partnersource/communities/training/trainingmaterials/student/course80297.htm?printpage=false

CustomerSource: https://mbs.microsoft.com/customersource/training/trainingmaterials/student/course80297.htm?printpage=false

Microsoft Learning: http://www.microsoft.com/learning/en/us/Course.aspx?ID=80297A&Locale=en-us

Microsoft Dynamics NAV and SQL Server Database Compression

Microsoft SQL Server 2008 introduces two new compression features (available in Enterprise Edition) that are of interest to users with large databases. Data compression applies to individual tables and indexes within a database and comes in two options: ROW and PAGE. Backup compression is a new option when backing up a database to external storage. Both compression techniques can be used to reduce the amount of online storage required for databases. Data compression can be configured for an entire heap (table with no clustered index), clustered index, non-clustered index, or indexed view. For partitioned tables and indexes, the compression option can be configured separately (and differently) for each partition. Compression can also reduce disk utilization and sql memory utilization as dead is stores on disk in a compressed state and also reads in the SQL cache in a compressed state. Compression can add 10 - 30% percent increased CPU utilization depending on what tables and indexes are compressed and what level of compression is used.

For Dynamics NAV we recommend only compressing tables and indexes that have a read to write ration of 80%/20% (This is a conservative threshold) or higher as compressing tables with a higher write ratio can actually decrease performance. We also recommend using ROW compression if the space saving between ROW and PAGE level compression is less that 10%; if the difference is over 10% then we recommend PAGE compression. This is because if the space savings from PAGE compression is close to or similar to ROW compression then it is not recommended to incur the additional overhead associated with PAGE compression. An example of NAV tables that would benefit greatly from compression are the large "Entry" tables such as G/L Entry, Value Entry, and Item Ledger Entry. An example for NAV tables that would not benefit from compression and where performance may actually decrease due to compression are "Line" tables where the data is temporary in nature such as Sales Line, Purchase Line, and Warehouse Activity Line. SQL Server compression is completely transparent to the Dynamics NAV application.

Compression is done on Table or Index basis. On tables with clustered indexes the clustered index is the table so compressing the clustered index is equal to compressing the table. Running the ALTER TABLE.. WITH COMPRESSION is only necessary on HEAPS for all tables with Clustered Indexes you can use the ALTER INDEX.. WITH COMPRESSION.

How to determine the read/write ratio of an index? Luckily SQL keeps track of this for us and all we need to do is extract this data. SQL Server stores this information in the sys.dm_db_index_operational_stats DMV. Remember DMV's are "recycled" each time the SQL Server service is restarted so if SQL has only been up and running for a day or a week this information will be of minimal use. Ideally you would want the server to be up any running for several weeks and through a month end close to get a true idea of actual data access patterns of your database.

The following query will tell you how long the SQL Server instance has been up and running:

select 'Sql Server Service has been running for about '
+ cast((datediff(hh, create_date, getdate()))/24 as varchar(3)) + ' days and '
+ cast((datediff(hh, create_date, getdate())) % 24 as varchar(2)) + ' hours'
from sys.databases where name = 'tempdb'

The following query will give the approximate read write balance of all the used indexes in the database.

SELECT o.id,
o.name,
x.name,
i.index_id,
x.type_desc,
s.rowcnt,
i.leaf_update_count * 100.0 /
(i.range_scan_count + i.leaf_insert_count
+ i.leaf_delete_count + i.leaf_update_count
+ i.leaf_page_merge_count + i.singleton_lookup_count
) as Writes,
i.range_scan_count * 100.0 /
(i.range_scan_count + i.leaf_insert_count
+ i.leaf_delete_count + i.leaf_update_count
+ i.leaf_page_merge_count + i.singleton_lookup_count
) as Reads,
FROM sys.dm_db_index_operational_stats (db_id(), NULL, NULL, NULL) i
JOIN sys.sysobjects o ON o.id = i.object_id
JOIN sys.indexes x ON x.object_id = i.object_id AND x.index_id =
i.index_id
JOIN sys.sysindexes s ON s.id = x.object_id and s.indid = x.index_id
WHERE (i.range_scan_count + i.leaf_insert_count
+ i.leaf_delete_count + leaf_update_count
+ i.leaf_page_merge_count + i.singleton_lookup_count) <> 0
AND objectproperty(i.object_id,'IsUserTable') = 1


You can also run a simulation with the sp_estimate_data_compression_savings stored procedure in SQL with will run a sample of the data through the chose compression level and give you the estimate of the space saved by enabling compression.

I strongly recommend reading the following MSDN article before engaging in database compression activities.

http://msdn.microsoft.com/en-us/library/cc280449.aspx

Note: You can use the following query to check to see if there are currently any compressed indexes in the database.

SELECT o.name Table_Name, p.index_id as Index_ID, i.name as Index_Name,
CASE
WHEN p.data_compression = 1 THEN 'ROW Compression'
WHEN p.data_compression = 2 THEN 'PAGE Compression'
ELSE 'ERROR'
END Compression_Type
FROM sys.partitions p
JOIN sys.objects o ON p.object_id = o.object_id
JOIN sys.sysindexes i ON o.object_id = i.id AND p.index_id = i.indid
AND p.data_compression in (1,2)
ORDER BY o.name, p.data_compression, p.index_id


Source:
http://blogs.msdn.com/b/nav/archive/2011/02/11/microsoft-dynamics-nav-and-sql-server-database-compression.aspx

Tuesday, May 25, 2010

Microsoft Announces the Availability of Management Reporter for Microsoft Dynamics ERP

Microsoft has now announced the general availability of Management Reporter for Microsoft Dynamics ERP. Management Reporter, formerly codenamed Management Reporter 2.0, will act as the replacement for Microsoft FRx,

www.newscom.com/cgi-bin/prnh/20000822/MSFTLOGO

Management Reporter extends the proven functionality of Microsoft FRx and enables people to quickly and easily create, generate, help secure and publish professional-looking financial statements, such as profit and loss statements, balance sheets, and cash flow reports, and will also allow them to take advantage of the following:

• Custom reports without IT assistance. These reports reduce the burden on the IT department by empowering the finance team to create its own financial statements.

• Deep cross-functional analysis. Management Reporter provides easy and accurate financial reporting, intercompany reconciliations and eliminations.

• Reduced training time and increased productivity. A familiar user interface and reporting tools minimize training time since users will easily be able to transition from Microsoft Office applications to the similar navigation pane and toolbars in Management Reporter.

• Strong data integrity and report accuracy. Management Reporter supports regulatory requirements, such as generally accepted accounting practices and international financial reporting standards.

"Management Reporter is like Microsoft FRx on steroids — it takes the familiar building blocks of Microsoft FRx and revolutionizes the way reporting and business intelligence can be delivered," said Les Wright, senior consultant, BDO Canada LLP, a Microsoft Dynamics partner. "This is something customers have been asking for and provides even more value to their Microsoft Dynamics ERP solutions."
Microsoft FRx customers making the transition to Management Reporter will experience a variety of new features including the following:

• Direct integration to the Microsoft Dynamics ERP general ledger. This integration aids in simplified, real-time reporting with greater accuracy.

• Reusable building blocks. Blocks of Report, Row, Column and Tree definitions can be mixed and matched to produce a wide variety of boardroom-quality reports.

• A Report Library. A Report Library is where reports can be secured, stored, and viewed

Management Reporter is available for Microsoft Dynamics GP 2010 customers at NO ADDITIONAL COST and will be available with future releases of other Microsoft Dynamics ERP solutions.

To assist customers currently using Microsoft FRx make the transition to Management Reporter, a migration tool, detailed guidance and information is available at

www.microsoft.com/dynamics/en/us/products/management-reporter.asp

Thursday, April 15, 2010

Direction of Microsoft Dynamics NAV

Based on Microsoft Dynamics NAV Statement of Direction – April 2010

Microsoft has now announced that NAV is going to support for Unicode with the release of Dynamics NAV "7", which will be released next year - 2011. This will also mean that we are finally going to say goodbye to Navision's native database, which otherwise have served very well basically since the release of the first DOS version of Navision in 1987. It is a goodbye to this REALLY GREAT & SUPER STABLE database.

Unicode has been too much of a worry to the average Navision customer. But for international customers, who have been working with many different countries in the same database, then it's going to be a great help.

NAV "7" will also be another goodbye. With the release of NAV “7”, "Forms" are also going to be disappeared. "Forms" have been the data presentation object until NAV 2009; however with the introduction of the “Role Tailored Client” - “RTC”, it is now the "Pages" which is providing the data presentation to the user. The "Forms" are still used in the Classic Client, but now with the removal of the "Forms" then the typical NAV user will no longer be able to use the Classic Client. (Fortunately) Developers will still have to use the Classic Client, until new development tools will be available in the “Role Tailored Client” with NAV "8" in 2013.

Future of NAV Development Environment

The C/SIDE development environment is going to be replaced from Classic Client to RTC. As you know, still we have to depend on the NAV Classic Client for making any customization, even though we do the implementation in RTC, but this structure is going to replace with the upcoming versions of Dynamics NAV. Some of the highlights would be as follows;

1. No Object Designer! Simple. This will be replaced with Designer Home Center; it will be another role center which allows developers/consultants to make any changes to the standard objects of the application.

2. Page Designer will be replaced with another page where it will allow you to proceed with your table customizations. This feature will be brought into the other object types as well.

3. In the Object List, developer will find the all objects including data about where they used and information about the usage.



4. No Visual Studio! Own simple editor for making all changes in Code Units.



5. The structure of the Editor would be more towards to the look & feel of the Visual Studio. For example the Symbol menu is to be replaced; any parameter that you define will be available in the top of the code lines.

To be continued …

Source:
www.dynamicsuser.net/blogs/kine

Business Central SaaS Extension Design: Implementing Plant Tracking with AL Event Subscribers

  Extending Business Central SaaS: Plant Tracking Using AL Extensions  1️⃣ Problem Statement In many manufacturing and service-oriented or...