Saturday 20 December 2014

How to Identify Client Type via Code - Dynamics NAV


The following Microsoft Dynamics NAV clients interact with the Microsoft Dynamics NAV database through Microsoft Dynamics NAV Server:
  • Microsoft Dynamics NAV Windows client
  • Microsoft Dynamics NAV Web client 

If we have to differentiate development for Windows Client and Web Client then how to identify the client via code?

We have 2 functions available in Codeunit 419 - File Management called IsWindowsClient and IsWebClient.


Friday 12 December 2014

Pipe Filter with Excel | Alternative 2




I looked at the video by Kerry Rosvold on how to make a pipe filter in excel here and MVP Mark Brummel’s alternative here  . Both are awesome.


I have also an alternative way.


So this is how I do it.

You copy a few lines to excel like this:


And in Excel you paste, and Remove all other columns except No.




Add pipe (|) in B1 cell and =A1 in B2 cell and Enter



Add below formula in B3 cell and Enter
 =B2&B1&A3


Now it looks like



Re Select B3 Cell and select B1 value and Press F4 (which makes Pipe value Constant)



Now formula in B3 looks like
=B2&$B$1&A3

B1 is changed as $B$1


Copy B3 cell and paste in all below cells


The last row has the final filter.


Friday 5 December 2014

Restore fails with error "The media set has 2 media families but only 1 are provided. All members must be provided."

I was trying to restore a SQL backup (.bak) file of NAV2013R2 and got this error message.



The media set has 2 media families but only 1 are provided. All members must be provided.

Msg 3132, Level 16, State 1, Line 1 
The media set has 2 media families but only 1 are provided. All members must be provided. 
Msg 3013, Level 16, State 1, Line 1 
RESTORE DATABASE is terminating abnormally.


I tried many ways but still got same error.

I tried to take backup again to check whether I can find anything strange.
I noticed having 2 Destination files added while taking backup.



This error is due to your backup being divided into more than one part at the time of creating your backup file.

Remove one path from the backup destination so that only one .bak file is created.
Now I was able to restore the backup file successfully.