Deleted Document

Have you ever seen a deleted document in the Posted Document, e.g. Posted Purchase Receipt?

That is because of this:

When you post the Purchase Order, at some point it will get the Purchase Receipt No. from the Receiving No. Series. It will increment from the Last Used No. in that Receiving No. Series. Once gotten, it will update the Last Used No in that No. Series. That no. will be used in the Receiving No. in Purchase Header.

At some point later, there is a COMMIT code, so that Receipt No. is already reserved. Once there is a COMMIT code and you get an error after the COMMIT, you can’t rollback to the initial state before the Purchase Receipt get the number. Hence the Receipt No. is already reserved.

Because of the audit trail requirement, Posted Document No. cannot be missing. But in this case, the Purchase Order has reserved the Receipt No. Hence, when somehow you must delete the Purchase Order, NAV will create (post) a Posted Document using that reserved number. But, with the line description as Deleted Document, to make it clear to the user, that this is created from a deleted document, instead of posting transaction.


Caution! The merge cmdlets might merge incorrectly!

NAV2015 introduced new object merge functionality to ease upgrading of NAV databases dramatically. For information about the cmdlets you could start here: I reported an issue to Microsoft back in t…

Source: Caution! The merge cmdlets might merge incorrectly!

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:

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.

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:{1}+{2}+{6}&v=2&mkt={7}
  • Directions Service:{1}+{2}+{6}~adr.{1}+{2}+{6}&v=2&mkt={7}&rtop={9}~0~0
  • Directions from Location Serv.:{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:,+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:{1}+{2}+{6}
  • Directions Service:{1}+{2}+{6}/{1}+{2}+{6}
  • Directions from Location Serv.:{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 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:


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
  Value of '-0.2189909' is not valid for 'FillWeight'. 'FillWeight' must be greater than 0.
  Parameter name: FillWeight
     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
  Value of '-0.2189909' is not valid for 'FillWeight'. 'FillWeight' must be greater than 0.
  Parameter name: FillWeight
ParamName: FillWeight
     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.