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"

Friday 24 June 2016

Folder Browse in RTC - Using Standard Inbuilt Code - NAV 2015 and Above

Hello Everyone,

There are several ways to Browse a Folder in RTC but one of the standard way is as below.


Folder Browse Using Standard Code – (One Line Code)

Standard Code

Code:
FolderPath := FileManagement.BrowseForFolderDialog('Title - Sun','Nav Shortcuts',TRUE);

Output:

Folder Browse Output

And its done.

Your valuable comments and feedback are appreciated.

"Power is gained by Sharing Knowledge not hoarding it"

NAV 2009 R2 and Lower - Save Export to Excel - At a specific Location

Hello Everyone,

If we want to Export Data to Excel and Save that file at a particular location, here is one of the simplest way to do it.

We all know the famous blog of Saurav Dhyani“NAV 2013 & NAV 2013 R2 - Save Export to Excel” – But it is for Navision 2013 and above.

 

http://saurav-nav.blogspot.in/2014/01/nav-2013-nav-2013-r2-save-export-to.html

 

 What if we want to do the same in Navision Older Version?

 

Here is the way,

 

Step 1 – Create a Field in Setup Table in my case its “Sales & Receivables Setup”.

 

Path


 

Step 2 – Adding that field to Form “Sales & Receivables Setup”

 

Form

 

Step 3 – Add a function “Save Excel File” in Table 370 Excel Buffer

 

Excel Buffer Function

 

Step 4 – Calling from a Report

 

Function Call

 

And it’s done.



Your valuable comments and feedback are appreciated.

"Power is gained by Sharing Knowledge not hoarding it"

Refresh Page

Hello Everyone,

If we want to refresh a page after some action here is one of the simplest way to do it.

First of all create  a function called RefreshPage as shown in below snapshot..

Code:


Function Code









Variable Name - WshShell
Data Type - Automation
Sub Type - 'Windows Script Host Object Model'.WshShell

Function Call: - RefreshPage

The function should be called from an appropriate place where required and page would get refreshed after than action.

And its done.


Your valuable comments and feedback are appreciated.

"Power is gained by Sharing Knowledge not hoarding it"

First Date and Last Date of a Month

Hello Every One,

This is my first blog and let me start with a small but interesting thing.

If we want to find the First and Last Date of a month from a particular date here is one of the simplest way.

Code:

Code

Output:

Output












Note - You can replace TODAY with any date to get the desired result.

And its done.


Your valuable comments and feedback are appreciated.

"Power is gained by Sharing Knowledge not hoarding it"