A quick way to get async/await for WCF calls in Xamarin

Just a quick a way to consume WCF services with async/await:

Step 1.
Generate the proxy code with SLSVCUTIL.EXE, there are plenty of examples for that “out there” :)

Find your client class and the interface – In this example they are called ProxyClient and Proxy (interface) and the method we are wrapping is called “Call” thant takes a string parameter and returns a string.

Step 2.
Create a small wrapper method, example:

public async Task CallService(string Parameter)
{
ProxyClient client = new ProxyClient(new BasicHttpBiding(), new EndpointAddress("http://host/service"));
var t = Task.Factory.FromAsync(
((Proxy)client.InnerChannel).BeginCall,
((Proxy)client.InnerChannel).EndCall,
Parameter,null);
return await t;
}


Step 3.
Call the method:

result = await CallService("test");

Thats the shortest version I can come up for solving the missing async/await support for WCF services. You should remove the ProxyClient construction to somewhere else depending on your WCF consumption to reuse the client.

Running the NAV2015 service tier console mode

Normally you will always run the Dynamics NAV Service Tier as a service. But some crazy people might want to run it directly from a console, or just from a shortcut.

That can be done, just use the following parameters:

Folder: C:\Program Files\Microsoft Dynamics NAV\80\Service
Executable: Microsoft.Dynamics.Nav.Server.exe

Parameter 1: $<name of service>
Parameter 2: console
Parameter 3: config
Parameter 4: <fullpath of config file> Example: “C:\Program Files\Microsoft Dynamics NAV\80\Service\Instances\NAV80\NAV80.config”

NAV will accept the parametes prefixed with – or / or without prefix (as shown above)

Thats it, putting that together runs the server from a shortcut or from a console.

The end of an era :(

Mainstream support for “Classic Navision” ends on the January 15th 2015

https://mbs.microsoft.com/customersource/northamerica/NAV/support/support-news/MainstreamSupportNAV2009

This concludes a long story that started back in 1996 when Navision Financials took over from Navision 3.56 – the character based Navision.

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.