Caution! The merge cmdlets might merge incorrectly!

Grumpy NAV Dev

NAV2015 introduced new object merge functionality to ease upgrading of NAV databases dramatically. For information about the cmdlets you could start here: http://blogs.msdn.com/b/nav/archive/2014/10/03/merging-application-objects-using-windows-powershell-in-microsoft-dynamics-nav-2015.aspx

I reported an issue to Microsoft back in the middle of December 2014, and after more than one month of e-mails back and forth I got this response:

(…)
This by design and won’t be fixed. We are applying a 3-way merge on the function body including comments. The 3 merge searches for similar code when doing a merge an the out-commented code gives the best match. The customer would see a similar issue by using other 3-way merge tools like Beyond Compare. The current design also supports merging of comments which can contain valuable information that should also be merge.
(…)

I now give up, and instead of trying to convince Microsoft to fix the cmdlets, I instead wish to warn the NAV community about this…

View original post 348 more words

Using Google Maps in NAV 2016

Since Microsoft Dynamics NAV 2009 (version 6.0), there is a feature called Online Map, that we could use to open the map to show the location of the Customers, Vendors, etc.

Unfortunately, it will open Bing Maps, and we could not use others than Bing maps, for example Google Maps.

The good news is that NAV 2016 has provided the users with that flexibility to choose the map application.

To use Google Maps as your map application, it is very easy.

First, open Online Map Setup (800) page, and then click on Parameter Setup page:

online-map-setup

Online Map Setup.

There you can set the parameter used to throw the parameter from NAV to open the link.

Online Parameter Setup

Online Map Parameter Setup.

 

There is one record for default. That is for Bing maps.

Looking the pattern, we can use the pattern, to use it for Google maps. The parameters are very obvious, for example:

  • Map Service:
http://bing.com/maps/default.aspx?where1={1}+{2}+{6}&v=2&mkt={7}
  • Directions Service:
http://bing.com/maps/default.aspx?rtp=adr.{1}+{2}+{6}~adr.{1}+{2}+{6}&v=2&mkt={7}&rtop={9}~0~0
  • Directions from Location Serv.:
http://bing.com/maps/default.aspx?rtp=pos.{10}_{11}~adr.{1}+{2}+{6}&v=2&mkt={7}&rtop={9}~0~0

Looks so easy, isn’t it?

So, create a new record for your new Google Maps parameter.

How to get the address? Very easy, just open the Google maps on your browser, then copy the web address:

https://www.google.com/maps/place/10+Lake+Rd,+Wimbledon,+London+SW19+7EG,+UK/@51.42459,-0.2090028,17z/data=!3m1!4b1!4m5!3m4!1s0x487608b696bc9bf9:0x9d99e609e3434a5f!8m2!3d51.42459!4d-0.2068141?hl=en

Unfortunately, it just looks not as easy as we thought before. The address is very complex, and I could not figure it out, until I Google it and I found one good article about Google maps parameter, and these are what it will looks like:

  • Map Service:
https://www.google.com/maps/place/{1}+{2}+{6}
  • Directions Service:
https://www.google.com/maps/dir/{1}+{2}+{6}/{1}+{2}+{6}
  • Directions from Location Serv.:
https://www.google.com/maps/dir/{10}+{11}/{1}+{2}+{6}

Beware that never click on the Insert Default button on the ribbon, since it will erase ALL of the parameters, and then will overwrite it with the default Bing maps parameter!

Insert Default.png

Never click Insert Default button!

 

Look at the Online Map Substitution Parameter FactBox at the right hand corner, and it will describe what is the meaning of those number parameters:

online-map-subtitution-parameter-fact-box

Online Map Substitution Parameter FactBox

Don’t forget to change the Map Parameter Setup Code to your new Google Maps parameter:

Online Map Setup Google.png

Change Map Parameter Setup Code to your new Google parameter.

 

Finally, let’s try open the Vendor card, and then click Online Map on Navigate:

online-map-button-vendor

Click Online Map button on Vendor Card

 

And then, voila! It will open Google Maps, instead of Bing! 😉

Google Maps for Vendor 10000.png

Google Maps will open, instead of Bing

Could not drill-down Item list in field “No.” on Sales Order subform

One of my user report that he could not see the Item List when drill-down the Item No. field in the Sales Order sub-form. Instead, the NAV crashed. Here is the event viewer:

Type: System.ArgumentOutOfRangeException
Message:
  Value of '-0.2189909' is not valid for 'FillWeight'. 'FillWeight' must be greater than 0.
  Parameter name: FillWeight
StackTrace:
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.<>c__DisplayClass2.<DoRethrowWithCatchException>b__0()
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.ExecuteAndCatchExceptions(Func`1 execute)
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.DoExecute(Func`1 execute)
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.DoRethrowWithCatchException(Exception exception)
Source: Microsoft.Dynamics.Nav.Client
----------------------------------
Type: System.ArgumentOutOfRangeException
Message:
  Value of '-0.2189909' is not valid for 'FillWeight'. 'FillWeight' must be greater than 0.
  Parameter name: FillWeight
ParamName: FillWeight
StackTrace:
     at System.Windows.Forms.DataGridViewColumn.set_FillWeight(Single value)
     at Microsoft.Dynamics.Framework.UI.WinForms.RepeaterControlAdapter.UpdateUserColumnFillWeight()
     at Microsoft.Dynamics.Framework.UI.WinForms.RepeaterControlAdapter.PostLoad()
     at Microsoft.Dynamics.Framework.UI.WinForms.RepeaterControlAdapter.OnDataLoaded()
     at Microsoft.Dynamics.Framework.UI.Windows.ContainerLogicalControlAdapter.OnDataLoaded()
     at Microsoft.Dynamics.Framework.UI.Windows.ClientSessionBase.OnFormToShow(LogicalForm logicalFormToShow, LogicalControl originatingLogicalControl)
     at Microsoft.Dynamics.Framework.UI.WinForms.ClientSession.OnFormToShow(LogicalForm logicalFormToShow, LogicalControl originatingLogicalControl)
     at Microsoft.Dynamics.Framework.UI.Windows.ClientSessionBase.OnLookupFormReady(LookupFormReadyEventArgs e)
     at Microsoft.Dynamics.Framework.UI.Windows.ClientSessionBase.LookupFormReady(Object sender, LookupFormReadyEventArgs e)
     at Microsoft.Dynamics.Framework.UI.UISession.OnLookupFormReady(LookupFormReadyEventArgs e)
     at Microsoft.Dynamics.Framework.UI.LookupAction.InvokeCore(Boolean async, LogicalControl logicalControl, Object state, UISession uiSession)
     at Microsoft.Dynamics.Nav.Client.Actions.NavConditionalLookupAction.InvokeCore(Boolean async, LogicalControl logicalControl, Object state, UISession uiSession)
     at Microsoft.Dynamics.Framework.UI.Action.InvokeCoreWithErrorHandling(Boolean async, LogicalControl logicalControl, Object state, UISession uiSession)
     at Microsoft.Dynamics.Framework.UI.Action.DoInvoke(LogicalControl logicalControl, UISession uiSession)
     at Microsoft.Dynamics.Framework.UI.Action.Invoke(LogicalControl logicalControl)
     at Microsoft.Dynamics.Framework.UI.Windows.ActionsHelper.InvokeDefaultLookupAction(LogicalControl control, Boolean useLookupStringValue, String lookupValue)
     at Microsoft.Dynamics.Framework.UI.Windows.ActionsHelper.InvokeDefaultLookupAction(LogicalControlAdapter adapter)
     at Microsoft.Dynamics.Framework.UI.WinForms.LookupFormConnector.ApplyAsYouTypeFilter(String filter)
     at Microsoft.Dynamics.Framework.UI.WinForms.StringControlAdapter.FilterAsYouTypeFilterTimer_Tick(Object sender, EventArgs e)
     at System.Windows.Forms.Timer.OnTick(EventArgs e)
     at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
     at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Source: System.Windows.Forms

I do not know what is the cause, but here it is the solution: Reset UI Settings.

Open the user’s NAV:

Customize | Role Tailored Client | Delete Personalization Settings | Reset UI Settings.

And, voila! He could drill-down the Item No. again.