20 August 2016

Allow users to filter random records in Dynamics NAV

Most of the users would like to select few records (No commonly shared value) and filter them to a single view. I have seen many of the users use export to excel option available in Microsoft Dynamics NAV and then filter the records from excel so that they can compare them freely. 

What if we can provide an option for the users to ease their life by adding custom filter option. I had a small idea about MARK record option in Dynamics NAV and start to look for a better solution. Then I found a nicely written blog article by Mark Brummel (One of the best) about the Mark functionality in Dynamics NAV. 

Let's start to make a custom filter function to Dynamics NAV. If you generalize this then this can be able to use globally within Dynamics NAV. 

My requirement is, able to select random records in a list page and then able to filter them to a one single view. 

To demonstrate this I will use Customer Ledger Entry page in Dynamics NAV. 
In here I want to add 3 buttons which will do following
01. Mark the records
02. Filter the marked records
03. Clear the filters

In order to add the buttons, I will open the Customer Ledger Entry page in the development environment and go to Action Designer

In the action Designer, let's add 3 buttons Mark, Marked Only and Clear Marks. Then I make them promoted and big and also added to Category4.

Then let's write small code to do the work.

Add above code to each OnAction trigger. Once you complete the code it will look like below

Now we are almost there, just move back to the page designer and open the properties of the page. In the PromotedActionCategoriesML add the Mark at the 4th option (Since we added our new buttons to Category4)

Before we exit from the page we have very small task to do. In order to visualize the Marked records we need to add a new field to the page. Add a new column and set the source field to "MARK". 

Once that is been done, compile and save the page. 
Let's run the page and it will look like below with nice ribbon with the all new custom filter buttons. 

Now user can select random records by clicking on the "Mark" button.

When the user click on the Mark button system will select the record and also it will show a tick mark in the page. Once the records are been marked, next step is to filter the marked records to have a one nice view. In order to do that user just have to click on the "Marked Only" button.

See.. System will filter the marked records and create a one simple view. Once the work is been done and user want to un-mark the view, user need to click on the "Clear Marks" button and it will un-mark the records.

But this is a empty record view and what has happen to the rest of the records?? To get all the records just click on the "Marked Only" button again.

User will get the original view with all the entries.

Simple?? Yes it is!! It is a really easy way to provide a custom filter to users. + We didn't work with any record variables or created any variables, you can just copy paste the action button to the other pages and use this functionality.

Or if you need you can make this function a global one with the use of a codeunit and RecordRef. Up to you to decide.

Hope this was helpful and if you need the page object you can get it from this link. Or you can use below code and directly add to the page (text).

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Read more »

17 August 2016

August 2016 Cumulative Updates for Microsoft Dynamics NAV

Microsoft has published new Cumulative Updates for August 2016: Please refer below links for more information.
CU 10 – Microsoft Dynamics NAV 2016 (Build 46621)
CU 22 – Microsoft Dynamics NAV 2015 (Build 46580)
CU 34 – Microsoft Dynamics NAV 2013 R2 (Build 46577)
CU 41 – Microsoft Dynamics NAV 2013 (Build 46576)

It is always good to update your environment to latest Cumulative Update because it will help you to not to make any mistakes.

Please provide your feedback with a comment.
Thank you and Regards,
Tharanga Chandrasekara
Read more »

Data Source name not found and no default driver specified. State ID: IM002 - Dynamics NAV

Hello everyone, It has been few weeks since my last blog post.
Directly into blog post,

Have you ever got below message when you try to open the database using development environment or classic client in Microsoft Dynamics NAV?

Today I got below error when I tried to open up the Microsoft Dynamics NAV 2013 Development Environment. When I try to select the server name or DB name I got the bellow error. 

Error: [Microsoft][ODBC Driver Manager] Data Source name not found and no default driver specified. State ID: IM002

Reason for the above error is SQL Server Native Client is not installed in the computer.

How we going to fix it,
Fix is very simple (for me), all I had to do is install the SQL Server Native Client. In order to do that you need to open the Microsoft Dynamics NAV 2013 product DVD.
01. Go to "Prerequisite Components" folder'
02. Open the "Microsoft SQL Server 2012 Express" folder
03. Install the "sqlncli64.msi"

Once that is done, you are ready to go.

Please provide your feedback with a comment.
Thank you and Regards,
Tharanga Chandrasekara
Read more »