A blast from the past – Meet FINSWEEP

I just stumbled over a little thing we made back in 1996. This is from the period when Navision Financials was being introduced. During a developer workshop, the teacher was trying to describe how powerful the new forms designer was (compared to the character based Navision 3.56a), he talked about the stuff he made, and ended with something like this: “I tried to make a minesweeper game, but that was beyond the limits of the designer”…

Challenge Accepted !

So the rest of the workshop was dedicated to creating a mine sweeper game, the result:
finsweep1

Some of the stuff with controls on top of each other, that when clicked on became invisible was never envisioned by Navision, and I do remember that most of the stuff was actually created in a text-editor to get around the fact that there are 64+64 controls sitting on top of each other.

The game is dated Marts 6th 1996 – and the sound about right, the object file is dated October 24 1996 – I think the difference, is that the first version of Financials did not a random function, so a psudorandom generator was created in C/AL, but since replaced with the built in random function.

finsweep2

All text are in danish, when loosing the game, you are mocked with a “Lad os håbe du er bedre til bogføring!” translated into “Lets hope you’re better at bookkeeping!”.

The “TAB …” is because I worked for a company called “TAB – The Absolut Businesspartner” – Not sure we where able to remove the leaderdots in Financials 0.99/1.00

It actually ended up in a bunch of customer installations, more or less as an Easter egg – typical hidden on the main menu, so if you clicked on the green/blue circle the game would start.
navision_financials

You can downloaded here and import and run it directly in any version up to 2009R2:
FINSWEEP

Could it be made in RTC ….

Wysiwyg Editing Control for Dynamics NAV 2013 and 2015

In Dynamics NAV 2013 R2 and 2015 there is a new format for control add-ins.  This control add-in is actually done in HTML/Javascript so it will work in both clients.

When running in the Role Tailored Client, a WebBrowser Controls is created for the control, one of the main challenges, is that the WebBrowser Control insist on being a Internet Explorer 7 browser, witch reduces the level of JavaScript that can be used and excludes all HTML5 based controls.

The control here, is a modified version of the Tiny Editor presented here:
http://www.scriptiny.com/2010/02/javascript-wysiwyg-editor/
Download the ZIP here:

HTMLedit

Inside the ZIP file you wil find:
EriksTinyEditorControl.zip (ZIP file to import into the Control Add-ins page.
TinyEditor_NAV.DLL (DLL file that need to be placed in the Addins folder, both in the client and on the server).
HTML Editor 2013R2 Demo.fob – A couple of demo objects to show the functionality

This is how it looks in the Role Tailored Client:

html-09 html-10

Install the interface in the addins folder

Unzip the TinyEditor_NAV.DLL into the Addins folder in the service tier, and on the development client (Not nessesary in 2015)

Register the controll add-in

You need to register the ZIP file in the  control add-ins register, if you fail to do this, you will get an error looking like this when starting a page with the control add-in.

 

Open page 9820 or search for control. It will looks like this, with a list over the controls you currently have installed in the database.

html-01

Create a new, give it EriksTinyEditorControl as name and c87fd1af2bffc7dc as public token.

After creating the line, you must import the  ZIP file – press import and select the EriksTinyEditorControl.zip file.

Now your database is ready to use the control add in.

Use the control in a Page

Create a simple field in a page, and select the control in the properties (In the ControlAddIn property)

html-03 html-02

Give the field a name (“Editor”)

To load a value into the editor, use the CurrPage.Editor.LoadHtml(Txt) method.
html-04

To get the value back from the editor is a bit more complicated since a javascript control is controlled asynchronous, so you must use the CurrPage.Editor.RequestSave() method, and the use the Editor::SaveCompleted(HTML : Text) event. In the example objects, the “Save button will trigger the Editor::SaveCompleted event.

Improvements in the NAV2015 Development Environment – Part 3

As a bi-product of the new report scheduler, it is now possible to get the parameters from  the request form with the return value from RUNREQUESTPAGE function. Its possible to call EXECUTE (Processing only reports) and PRINT with parameters. So we do not have to create crazy constructs to handle parameter to automated reports.

nav2015-x-7

Another new great feature in NAV2015 reporting, is the SAVEAS function that can return the report as XML data. (And save to streams also)

 

Improvements in the NAV2015 Development Environment – Part 1

Microsoft has made changes in the development environment for NAV2015, but they are small and easy to overlook. But nice additions to a development client that has existed for more than 19 years. (FINSQL.EXE)

So here goes, sit back and enjoy the couple of minutes :)

nav2015-x-1

Properties that you have changed will now be shown in black, a small improvement compared to the “Value without <>” way it was shown before.

nav2015-x-2

It is now possible to comment or un-comment a selection of lines of code. A natural extension of the indent functionality.

Another fun little feature, is that if you create a RECORD variable (local or global) and don’t specify the name, NAV will now create a nice camel cased name.

nav2015-x-3

Select Record and type the table name or number, and then press enter or arrow name.

nav2015-x-4

Then NAV creates “SalesLine” as the variable name, nice :)

 

 

Microsoft Dynamics 2015 – Tablet Client Quick Peek

One of the major new features in Dynamics NAV2015 is the tablet client. The tablet client runs on Windows 8, iPad and Android.

nav2015After logging on, the tablet client starts with the role center. Arranged a bit different than the RTC uses. On the left, we have the newly improved Cue tiles. They have the emotions bar at the top, that can be defined by the user to explain the value (color = bad etc.)

nav2015-11

 

Pressing the “…” (three dots) opens the menu notice the descriptive subtitles – also a new thing in NAV.

 

nav2015-2

Accessing a menu item opens that page with a nice animation.

nav2015-3

The sales invoice displays another new feature in NAV2015 – the simplified pages. Microsoft has created a set of pages with only the most used/necessary fields.

nav2015-4

List pages look the way we would think, but with a few new tricks. The search field search across multiple columns for the cost of not having filters.

 

nav2015-5Drill down still works..

 

 

nav2015-6Pressing the lookup “…” (What all old Navision people calls the F6 function) opens a fullscreen list with a “OK” and “Cancel” bar at the top.

 

nav2015-7The “burger menu” opens the navigation menu.

nav2015-8The graph can be adjusted right on the tablet to change the information.

In a nav2015-9In a lookup page the menu is accessible from the “…” at the top bar.

nav2015-10Another example of the menu system.

nav2015-12The really nice descriptive menu item.

Sneak peek conclusion

The NAV2015 tablet client looks and feels very good, quick and snappy. One of the other improvements in the NAV2015 release is a speedup of the Web Client, the tablet client and web client shares technology (the tablet client is actually written in Javascript).

The biggest drawback right now, seems to be the missing search field in the upper right corner, and the departments button in the lower left. That means, that the tablet client is locked down to the specific functionality that has been designated the specific role center.

I think that the tablet client will be a popular choice for many users, and this may put pressure on all the 3rd party client platforms.

In NAV 2013 R2 RecordRef.CURRENTKEYINDEX can return -1

In NAV 2013 R2, if a RecordRef does not have a active record, CURRENTKEYINDEX will return -1. IN NAV2009 and older, the value was 1 (As the number of the primary key).

If the value of CURRENTKEYINDEX is given to KEYINDEX – a index out of bounds error will occur.

This is not documented in the NAV 2013 R2 help.

Dynamics NAV 2013 R2 – GLOBALLANGUAGE(0) fails..

In NAV2009 and earlier, GLOBALLANGUAGE(0) would set the language in NAV to the “default” language of the classic client.

This undocumented feature does not work in NAV 2013 anymore. It will return an error saying:

Exception of type
'Microsoft.Dynamics.Nav.Types.Exceptions.
NavNotSupportedLanguageException' was thrown.

So you must instead set the language ID to the correct value. Use codeunit 43 for this.

How to draw inside a blob field with NAV 2013

With .NET interoperability it is possible to draw inside a NAV 2013 BLOB field. Consider the following snippet of code. “Picture Blob” is a BLOB field. We create a OutStream so we can write information into the blob. We must calc a BLOB field, even if its empty before getting the OutStream.

GenerateBitmap is a function that does the following:

  1. Creates a Bitmap instance (Size 50×50)
  2. Creates a Graphics instance on the bitmap
  3. Creates a SolidBrush in a specific color, in this case from a HTML color code.
  4. Draws an filled ellipse on the graphics in 0,0 -> 49,49 (bitmaps are 0-indexed)
  5. Saves the bitmap on the OutStream from our BLOB field.

All variables can be found in the System.Drawing Assembly.

This could be extended so we can draw on a existing BLOB field. So instead of creating a new Bitmap instance, we load the bitmap from an InStream.

And still saves to the OutStream. So you just have to create both the InStream and the OutStream from a BLOB.