Friday, 15 December 2017

Dynamics NAV - Upgrade to NAV 2018

Hello Everyone,

There are certain important points that needs to be taken care while upgrading to NAV 2018. 

You can find detailed steps to upgrade to NAV 2018 by following below link,



Task 10: Connect a Microsoft Dynamics NAV 2018 Server instance to the converted database

After converting your database to NAV 2018, when we try to connect NAV 2018 service it gets stopped automatically due to below reasons,


Point 1 - Page - 30 - Item Card - Field - "Net Invoiced Qty." - Control Id - 207

Error - Control Id 207

Control Id 207 is used in Page 30 once still while starting service it throws Error.

Item Card

Solution - Change Control Id from 207 to 1207 for field "Net Invoiced Qty."

Item Card Solution


Point 2 - Page - 31 - Item List - Action - "Show/Hide Power BI Reports" - Id - 141

Error -  Action - Id 141

Action Id 141 is used in Page 31 once still while starting service it throws Error.

Item List

Solution - Change Action Id from 141 to 1141 for Action "Show/Hide Power BI Reports"

Item List Solution


Point 3 - Page - 50 - Purchase Order - Field - "Ship-to" - Control Id - 84

Error - Control Id 84

Control Id 84 is used in Page 50 once still while starting service it throws Error.

Purchase Order

Solution - Change Control Id from 84 to 284 for field "Ship-to"

Purchase Order Solution


I hope this would help you a lot in upgrade to NAV 2018.

Your valuable comments and feedback are appreciated.

Monday, 7 November 2016

New DataType FILTERPAGEBUILDER - Navision 2016

Hello Everyone,

There is a new datatype introduced in NAV 2016 and it is called FilterPageBuilder, this datatype can be used to create a filter page that enables users to set filters on multiple tables. The page can have multiple controls i.e. multiple records and you can use that to capture filters on the records.
Following is an example how it can be used
Sample Code:
Variable - FilterPageBuilder ---- SubType of FILTERPAGEBUILDER

FilterPageBuilder.ADDTABLE(‘Customer Table’,DATABASE::Customer);
FilterPageBuilder.ADDTABLE(‘Item Table’,DATABASE::Item);
FilterPageBuilder.RUNMODAL;

The above code will open the following page

Resulting Output

Filter Page


You can also specify the field like we do using ReqFilterFields property on the request page of the report using ADDFIELD function below is another example
Customer is the record variable of Customer Table 
FilterPageBuilder.ADDRECORD('Customer Table',Customer);
FilterPageBuilder.ADDFIELD('Customer Table',Customer."No.");
FilterPageBuilder.RUNMODAL;

As you can see the first parameter should match with ADDRECORD to let the control know which field to show.


Filter Page


Once the user sets the filter on the page, we can get the filters from the page using GETVIEW function of the FilterPageBuilder and then set that to another record.


Example:

Customer2.SETVIEW(FilterPageBuilder.GETVIEW(Customer));

Where Customer2 is another customer record variable.


And its done.

Hope this helps.


Wednesday, 5 October 2016

Defining Automation Variables - Problem - Navision 2009 R2

Hello Everyone,

I was working with one of our clients for requirement that uses Automation Variable in Navision 2009 R2.

I had observed a very strange behavior while defining an Automation Variable.

I got the error shown in below snapshot while I was defining Automation Variable.


Automation


I found the solution for this very strange thing.

Solution Details
1 - For using Automation variable, we must upload developer license in database. Then we    can define the Automation variable datatype and use that.

2 - Even if we change the license to developer license then also it won’t work. We must upload the developer license.

Note – Navision would not give any compilation error if we define Automation variable using developer license and then upload back client license again and compile objects.


Hope this helps.

Your valuable comments and feedback are appreciated.

Wednesday, 21 September 2016

Multiple Input Values - Input Box - Navision 2013 and Above

Hello Everyone,

Sometimes client have a requirement of inputting one or more values at runtime and based on that result perform some actions. So I have implemented an input box that takes multiple values as input at runtime.

Kindly see below snapshots for details.

1 – Action – Enter Rows and Columns


Action



2 – Multiple values Input Box

Input Box


3 - Result

Result


Code

Name
DataType
Subtype
Prompt
DotNet
System.Windows.Forms.Form.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
FormBorderStyle
DotNet
System.Windows.Forms.FormBorderStyle.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
FormStartPosition
DotNet
System.Windows.Forms.FormStartPosition.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
LblRows
DotNet
System.Windows.Forms.Label.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
LblColumns
DotNet
System.Windows.Forms.Label.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
TxtRows
DotNet
System.Windows.Forms.TextBox.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
TxtColumns
DotNet
System.Windows.Forms.TextBox.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
ButtonOk
DotNet
System.Windows.Forms.Button.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
ButtonCancel
DotNet
System.Windows.Forms.Button.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
DialogResult
DotNet
System.Windows.Forms.DialogResult.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'



Run On Client


For all this variables “RunOnCilent” property must be set.


1 – Create Input Box as Form

Create Form


2 – Add Labels

Labels


3 – Add Text boxes


Text Boxes


4 – Add Buttons

Buttons


5 – Get Results

Result


And its done.

This can help in unnecessary use of objects.

Your valuable comments and feedback are appreciated.

Wednesday, 24 August 2016

Dll register and Unregister - Automation Variables - Navision 2009 R2

Hello Everyone,

I was working on one of the requirement form client regarding FTP in Navision 2009 R2 using Automation variables.

DLL Folder Location



General Approach – To register a dll - Using cmd

1 – Run cmd as administrator
2 – Go to main C: by using command – cd\
3 – Go to Folder FTPFileManagementWithSSL where your dll is located using command - cd FTPFileManagementWithSSL
4 – Execute Command - tlbexp FTPFileManagementWithSSL.dll /out: FTPFileManagementWithSSL.tlb
5 – Execute Command - "C:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm" /tlb: FTPFileManagementWithSSL.tlb FTPFileManagementWithSSL.dll
6 – Execute Command - "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil" /i FTPFileManagementWithSSL.dll

Dll Registered successfully – Only in those cases where Microsoft SDKs are installed.

But even using above approach I was getting error – “Automation Control was not registered Successfully” when I used Automation variable in code.

Error

---------------------------
Microsoft Dynamics NAV Classic
---------------------------
This message is for C/AL programmers:

Could not create an instance of the OLE control or Automation server identified by
GUID={6B57267D-A9B1-4C21-9360-E350B57C71AF} 2.0:{D70659DB-C298-3D6B-98BC-C369261DD352}:'FTPFileManagementWithSSL'.FTPFileManagementWithSSL.
Check that the OLE control or Automation server is correctly installed and registered.

---------------------------
OK  
---------------------------

Newer Approach – To register a dll - Using cmd and PowerShell – Windows server 2012

1 – Run cmd as administrator
2 – Go to main C: by using command – cd\
3 – Go to Folder FTPFileManagementWithSSL where your dll is located using command - cd FTPFileManagementWithSSL
4 – Execute Command - tlbexp FTPFileManagementWithSSL.dll /out: FTPFileManagementWithSSL.tlb
5 – Run Windows PowerShell as Administrator
6 – Execute Below Command – For Regasm
."C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" -codebase -tlb "C:\FTPFileManagementWithSSL\FTPFileManagementWithSSL.dll"

7 – Execute Below Command – For gacutil
Set-location "c:\FTPFileManagementWithSSL"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("c:\FTPFileManagementWithSSL\FTPFileManagementWithSSL.dll")
iisreset

Dll Registered successfully. And When I ran my code using Automation Variable my error got resolved.

Assembly


Also if we want to unregister dll from Gac execute below command,
Set-location "c:\FTPFileManagementWithSSL"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacRemove("c:\FTPFileManagementWithSSL\FTPFileManagementWithSSL.dll")
iisreset


Hope this helps.

Friday, 1 July 2016

Pad Char - In RDLC Report

Hello Everyone,

I was upgrading report from Nav 2009 R2 to Nav 2016. I found an interesting feature that I did in RDLC in correspondence to section property.

For one of the text box in Nav 2009 R2 I saw that a Pad Char property set to * as shown in snapshot 1. There is no such property in RDLC.

So I found a way to do this.


Snapshot 1 - Nav 2009 R2 - Section

Check

Snapshot 2 - Nav 2016 – RDLC – Code

RDLC

Code

Public Function MyPaddedString(ByVal Value As String)
    Return Value.PadLeft(27,"*")
End Function

Function Call

Function Call














Code
=Code.MyPaddedString(Choose(25,Split(Cstr(ReportItems!CompanyAddresses.Value),Chr(177))))

Snapshot 3 - Output – Nav 2009 R2

Check

Snapshot 4 - Output – Nav 2016

Check

And its done.

So similarly it can be done for Padding Right also.

Hope this thing some time helps in upgrading reports.


Your valuable comments and feedback are appreciated.

"Power is gained by Sharing Knowledge not hoarding it"

Saturday, 25 June 2016

Navision 2015 and Above - Maximum Length of Text Variable - Filter String

Hello Every One,

I would like to tell an interesting feature in Navision regarding Text variable used as filter string.

What is the maximum length of a Text Variable used as filter string?

Maximum length of a Text Variable used as filter String is 41,94,304 Characters = 64KB.


I came to know this when I created a Code-unit and got compilation error when my filter string exceeds its limit.

Variable Declaration

Filter Variable







I have got the error as shown in below snapshot when size of my variable Filter exceeded its length.

Error

Error Limit


Case Generation
1) Compilation Error - Give Static Value in variable exceeding its limit.
2) Run Time Error - A variable is assigned values based on certain logic and its limits exceed.

So if we are using a Text variable without specifying its length we can filter out almost maximum number of records.

"For Informative Purpose Only".


Your valuable comments and feedback are appreciated.

"Power is gained by Sharing Knowledge not hoarding it"