NAV TechDays 2011

Yesterday I flew from Keflavik, Iceland to Amsterdam and then traveled by train to Antwerp.  Here I am @NAV TechDays 2011

What

NAV TechDays is the name of a new conference, organized by mibuso.com.
The goal of this conference is to offer 2 days full of – technical only and highly relevant – sessions, related to Microsoft Dynamics™ NAV.

 

Session topics:

  • Administrating NAV ‘7.0’ with Windows PowerShell 2.0
  • High-Quality Test Automation for NAV Applications
  • Developer Tools
  • Form Transformation
  • Integration (CRM connector, Webservices, Windows Phone 7, …)
  • Mergetool
  • .NET and NAV Interop
  • Partner-ready Software: how to build software for others to maintain
  • Reporting story in NAV ‘7.0’
  • RoleTailored Client Add-ins, Visualization & Charting
  • Tools & tricks that make NAV development easier and more organized
  • Understanding Keys & Indexes with Dynamics NAV & SQL Server

Example on using NAV Web Service in Visual Studio vb.net

This is using the web service in my previous post.  In Visual Studio I start by adding the web reference.  Select Project -> Add Service Reference

Then select Advanced…

Then Add Web Reference…

Where I insert URL encoded string for the published codeunit including the company name.

I created a form with a listbox object and a button.  I used this code to insert all employee no’s into the listbox.
[code htmlscript=”false” lang=”vb”]Public Class Form1
Dim ClockID As String
Dim Success As Boolean
Dim DefCred As Boolean
Dim ResponseMessage As String
‘The Web Service
Dim NAVPunch1 As New WebService.NAVPunch
‘New set of credentials
Dim User As New System.Net.NetworkCredential

Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
If DefCred Then
NAVPunch1.UseDefaultCredentials = True
NAVPunch1.Url = ""
Else
User.Domain = ""
User.UserName = ""
User.Password = ""
NAVPunch1.Credentials = User
NAVPunch1.Url = ""
End If
ClockID = "{4A212826-CAF3-4E3C-9D97-6923A692A209}"

End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
‘ Get Employee List
ResponseMessage = ""
ListBox1.Items.Clear()
Dim EmployeeList As New WebService.EmployeeList
Try
Success = NAVPunch1.GetClockEmployees(ClockID, _
EmployeeList, _
ResponseMessage)
CheckBox1.Checked = Success
TextBox1.Text = ResponseMessage
If Success Then
For Each Employee In EmployeeList.Employee
ListBox1.Items.Add(Employee.No)
Next
End If
Finally
End Try
End Sub
End Class[/code]

File download with RTC

My earlier post on File Download used the responsestream property of WinHTTP. On my latest project I needed to use Windows Authentication on my website and found out that I needed to create the WinHTTP automation on client level to login with the current user. This also means that I cannot use built in streaming functions to download the file. Instead I used ADOStream function to download the file and in the example that follows I am saving the file to the temporary directory for the current user.
[code htmlscript=”false”]DownloadFile(URL : Text[1024]) FileName : Text[1024]
IF ISCLEAR(WinHTTP) THEN
CREATE(WinHTTP,TRUE,TRUE);

WinHTTP.open(‘GET’,URL,FALSE);
WinHTTP.send(”);

IF WinHTTP.status <> 200 THEN
ERROR(Text023,WinHTTP.status,WinHTTP.statusText);

FileName := WinHTTP.getResponseHeader(‘Content-Disposition’);
IF STRPOS(FileName,’filename=’) = 0 THEN
FileName := ”
ELSE BEGIN
FileName := COPYSTR(FileName,STRPOS(FileName,’filename=’) + 10);
IF ISCLEAR(ADOStream) THEN
CREATE(ADOStream,TRUE,TRUE);

IF ADOStream.State = 1 THEN
ADOStream.Close;

ADOStream.Type := 1; // adVarBinary
ADOStream.Open;
ADOStream.Write(WinHTTP.responseBody);

IF ISCLEAR(FileSystem) THEN
CREATE(FileSystem,TRUE,TRUE);

FileFolder := FileSystem.GetSpecialFolder(2);
FilePath := FileFolder.Path;
ADOStream.SaveToFile(FilePath + ‘\’ + FileName,2);
FileName := FilePath + ‘\’ + FileName;

ADOStream.Close;
END;

CLEAR(WinHTTP);[/code]
Where my variables are

FileSystem – Automation – ‘Windows Script Host Object Model’.FileSystemObject
FileFolder – Automation – ‘Windows Script Host Object Model’.Folder
WinHTTP – Automation – ‘Microsoft XML, v6.0’.XMLHTTP
ADOStream – Automation – ‘Microsoft ActiveX Data Objects 2.8 Library’.Stream
FilePath – Text[1024]

Got some visits

This web is slowly starting to appear in search machines and I got my first praise from a user that liked my Job Queue E-mailer solution. Please use my solutions and honor the copyright statement.

Hope that my effort will pay off, please visit my supporters website to support me.

@ms.is

Currently in house at MS having a few tasks to complete. The main task to build an application to handle grant requests that are imported from the company web.  Grant requests can be both for money and goods.  MS has a 140GB database with 80 users and are running Dynamics NAV 5.0SP1 client on 4.00 SP3 database.

Payroll for NAV 2009

I am currently busy designing and writing an upgraded payroll system for Dynamics NAV 2009.  The solution is based on an older version that has been on the market for over ten years.  The new design should be intuitive to use and be capable to handle all types of payroll calculation.

Skyrr Conference

Skyrr Conference was held at the Hilton Hotel in Reykjavik last Friday.  I was a speaker and my topic was a small Dynamics NAV solution that I wrote to create views in SQL for tables in order to simplify access to the database.  The views include field names in native language and both Boolean and Option fields are displayed as text fields with the current option caption as the value.  More on that solution later along with my slides from the lecture.