New Features in Dynamics NAV 2016

As you all know NAV 2016 was made generally available since october 5th world wide. So, its better to know the added features in NAV 2016 before using its actual environment.

Image source is from Microsoft website









  • Earlier NAV was available only in Desktop, Tablet and web client but now it is also available in phone
  • Power BI - A new tool was introduced recently from microsoft to analyze and organize data. In NAV 2016 it is possible to analyze NAV data since there's an improved integration with office 365.
  • You can bring the NAV 2016 Databases into effective action by using azure SQL Server.
  • It has introduced new functionalities such as posting preview, deferrals and positive pay(only for U.S)
  • Third parties can add their own data sources using NAV 2016. 
As you saw the additional features in NAV 2016 it is quick to implement and easy to use. 

Microsoft Dynamics NAV 2016(Formerly Corfu) has been released world wide

Its a very good new to all Dynamics NAV workers to know that Dynamics NAV 2016 has been released world wide and its now available in following countries.

AU-Austr​alia​
AT-Austria
BE-Belgium
CA-Canada
CZ-Czech Republic
DK-Denmark
FI-Finland
FR-France
DE-Germany
IS-Iceland
IT-Italy
MX-Mexico
NL-Netherlands
​NZ-New Zealand
NO-Norway
ES-Spain
SE-Sweden
CH-Switzerland
UK-​United Kingdom
US-United States
RU-Russia
W1

You can be redirected to download link of Dynamics NAV world wide as below:

https://mbs2.microsoft.com/fileexchange/?fileID=70f6f135-6769-40df-82cd-92e77e5c02e9

To Restore NAV 2009 Missing Data using NAV 2005 FDB file

I was facing a problem while working on one of the addons i.e I couldn't see any data in NAV 2009 R2 database. But I wanted to test it so I asked my colleagues about how to get data. 

They guided me many approaches. But one of the simple approach which I felt easy and which I couldn't find anywhere in rest of the blog posts is to restore the data using its earlier fdb file.

So, I decided to write this blog so that it might be useful to others also. Firstly,

Open NAV 2005 fdb file in 2009 IDE. This can be done by just double clicking on database.fdb file in the below path.

(DVD_Folder\CsideClient\program files\Microsoft Dynamics NAV\CSIDE Client\database.fdb)

Once you double-click that folder, the following dialog box will appear in 2009 NAV IDE.



Specify your User ID and Password(blank). 



Specify the .fdb backup file pathname in the Database Name field.

Following are the steps you need to follow while setting up the 2005 database in 2009 R2.
Go to Tools - > Security - > Windows Logins - > Specify your User ID in the ID field, -> Click on Roles tab and Select Role ID as 'SUPER' as shown in fig. below.

fig: shows USER ID                                                  fig: shows Role ID

Once you are done with this. You can open the database, open the company and start using the data's in various table.


Difference between FINDSET, FINDFIRST and FIND('-')

1. FINDSET :


  • Retrieves set of records.
  • Transaction begins with FINDSET Command. 

2. FINDFIRST : 
  • It will retrieve the first record
  • Retrieves only 1 record, the last one within filter, sorted accordingly.
  • Transactions begins when a call to update the database. (Insert, modify, delete).
  1. Opens the connection with database
  2. fetches the record from database
  3. closes the connection
Example:


IF EmployeeVar.FINDFIRST THEN

      MESSAGE('employee no. %1',EmployeeVar."Employee No.");

Since we are not repeating the process its better to use FINDFIRST if you're fetching only one time from the database.

3. FIND('-') :
  • It will also retrieve the first record
  • Retrieves only 1 record, the last one within filter, sorted accordingly.
  • Transactions begins when a call to update the database. (Insert, modify, delete).
  1. Opens the connection with database
  2. fetches the record from database
  3. doesn't close the connection until the condition is false.


IF EmployeeVar.FIND('-') THEN
REPEAT
      MESSAGE('employee no. %1',EmployeeVar."Employee No.");
 UNTIL EmployeeVar.NEXT=0;


Since we are repeating the process its better to use FIND('-'), it will work fine even if we use FINDFIRST but each time it retrieves the record it opens the connection and before fetching next record it closes the connection. Which reduces performance. 

So, it better to use FIND('-) for repeated retrieval of record. 

Major Differences between Run and RunModal function

I have browsed through lots of blogs and I nowhere found the proper example on how to use RUNMODAL Function. So, I taught of writing this blog so that it might be useful other NAV Developers.

RUN Function :


  • The page is opened and you can still go back to what you were doing on previous page.
  • We can switch to other page which is shown.

RUNMODAL Function:

  • The page is opened and you cannot go back to previous page until MODAL Page is closed.
  • We cannot switch to any other page until current page is closed.


Example :

Scenario :

Assume I want to filter a Customer table who has balance between 10,000 to 1,00000 and to display the filtered values in the Customer list page. You can do the following in the coding part.


Customer.CALCFIELDS(Balance);//Calculates flowfield values
Customer.SETRANGE(Balance,10000,100000);//apply filter range
IF Customer.FINDSET THEN
    PAGE.RUNMODAL(PAGE :: "Customer List",Customer);//opens the filtered list.




Fig. above shows only the filtered customers based on balance between 10,000 to 1,0000 range.

Some frequently used built-in functions in CAL programming

As a programmer everyone knows what is function..!! A function is nothing but a subprogram or a subroutine mainly used for code re usability. In CAL programming we call the code of a function as Trigger code.

Function call is written as same as in C programming-

result := add(a,2);
or
result := add(a+2*3,b);

Pass by value

Change i.e. made in function trigger if it doesn't affect the variables in calling trigger then it 's call by value.

If a change in function trigger affects the variables in calling trigger then it' s call by reference.
You cannot use constants for pass by reference.

actual parameter is used in a calling function trigger.
Formal parameter is used in called function trigger.

5 commonly used built-in functions are:

MESSAGE - Displays message on the screen

STRLEN - returns no. of characters used.
MAXSTRLEN - returns the defined length of  the string variable.
COPYSTR - Returns a part or whole of a string.
CLEAR - clears the passed-in variable.
ARRAYLEN - returns the no. of elements in an array.

1. DATA access functions :

GET, FIND, FINDFIRST, FINDLAST, FINDSET, NEXT 

GET function-doesn't respect filters, produces run-time error if it fails.

FIND-You can find a value based on specified key value and sorting order.

Avoid using find function as much as possible.

FINDFIRST- to find the first record in a table based on key and filter.

FINDLAST- to find the last record in a table based on key and filter.

FINDSET - to find set of records in a table that corresponds to specified set of filters.
note: In FINDSET you can iterate only from first to last. To iterate from last to first use FIND(+).
Usually, we use this in combination with repeat-until loop.

NEXT - used with FIND and FINDSET to step through records of the table.


2. SORTING AND FILTERING functions : 

For key selection,sorting and filtering we use these functions.

SETCURRENTKEY - To select a key for a record.

SETRANGE - sets a simple range ex. to restrict a phone no. to be b/w 8 to 14 numbers we use this.

SETFILTER - It includes in more general way, These filtering includes placeholders, operators, wildcard expressions.

GETRANGEMIN and GETRANGEMAX


retrieve the minimum or maximum value of the filter that is currently in effect on a field.

4. DATA MANIPULATION functions

INSERT - inserts a record in a table

MODIFY - changes an existing record

MODIFYALL - performs bulk update of record. Respects filters. It doesn't return values and it doesn't display any errors.

DELETE - to delete a record from the database. 

DELETEALL - to delete all records that are selected by the filter settings.

5. Frequently used functions with fields

CALCFIELDS - to calculate flowfields,
if you're accessing record from the code then calcfields must be explicitly specified. 
Rec or xRec variable is automatically calculated when a record is retrieved. (no need to call here)

SETAUTOCALCFIELDS - improves performance by reducing no. of round trips to database. 

CALCSUMS - calculates total of a column in a table. It respects filters.

note : Maintaining an index for a SumIndexField improves the performance of CALCSUMS, but may decrease the performance of insert, modify, and delete operations.

FIELDERROR - stops execution of code causing run-time error. It creates an error message for a field. 

FIELDCAPTION - returns caption of a field. We can show the messages very accurately to user by displaying FIELDERROR along with fieldname. 

INIT - initializes record by assigning default values. 
This function is not applied for primary key. 

TESTFIELD - tests if value of field matches the specified value. 

VALIDATE - to call OnValidate trigger of a field. It checks the business rules and makes sure that it is not violated by storing invalid value in the field. 

6. USER INTERACTION functions:

MESSAGE - displays a text string in a message window. 
It's displayed after CAL code finishes execution or when it waits for user interaction. 
% - placeholder
\ - new line character 

CONFIRM - prompts the user for yes/no option. (to confirm that user wants to continue with the process)

STRMENU - creates a menu window that displays series of options from a comma-delimited string.

ERROR - displays error message and ends the CAL execution. All uncommitted data are rolled back. 


7. String Functions:

MAXSTRLEN, STRLEN, STRPOS(case sensitive), COPYSTR, LOWERCASE, UPPERCASE, INCSTR, SELECTSTR(retrieves sub-string from a comma separated string).

8. Date Functions:

DATE2DMY, NORMALDATE, CALCDATE, CLOSINGDATE

9. Numeric functions:

ROUND, ABS, POWER, RANDOM, RANDOMIZE

10. ARRAY functions:

ARRAYLEN,COMPRESSARRAY, COPYARRAY

11. STREAM functions:

CREATEINSTREAM, CREATEOUTSTREAM, READ, READTEXT, WRITE, WRITETEXT, EOS, COPYSTREAM,

12. System functions:

EXIT, CLEAR, CLEARALL, EVALUATE, FORMAT




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...