Labels

Tuesday, July 19, 2011

Using web-service to send SMS from NAV

Recently I had a task to send SMS notification through the Webservice.
My service provider use following interface protocols.
Request for sending SMS:
Where:
  • login and password are the authentication parameters;
  • id is the internal message ID;
  • recipient is the mobile phone number of the recipient;
  • sender is a sender description;
  • text is a message text.
This request should be posted to a webservice via HTTP or HTTPS.

Tuesday, July 12, 2011

Item lookup with built-in search

Let's take a look at the operations, that manager executes every time he adds new item to an order:
1. Pushes lookup in the No. field
2. Goes to a Description field and starts to write an item name.
3. Chooses a necessary item.
If a user knows an Item name, then he can write it directly in No. field. NAV will search for an Item, that begins with an entered phrase and insert it's code to a No. field. It is because of AltSearchField property, setted for the Item table.
But what if several items, which Description field contains entered phrase exists? NAV will find only first of them... It's not convinient and that's why users prefer searching items in the item list, spending more time for every line.

My suggestion is to let the user choose an item from a list, if there are several items, that complies his request. It's a kind like incadea does...

Subform detail or summary view

Often there is so many fields on a subform, that user become confused. It's a standard Navision way, that user can customize those fields, that he wants to view on the subform. But, I think, more user-friendly is to have a button, that switches from summary view to details if user wants to enter extra-data.
Lets take for example Sales Order. I've created 2 buttons, place them on each other below the subform: bSum & bDetails.
bSum is not Visible by default (property Visible = No), it means the Summary view will be shown by default and user can switch to Details.

Saturday, July 9, 2011

Using LumiSoft.Net for retrieving e-mail from Dynamics NAV

Recently, I've found great library for net handling (POP, SMTP, FTP, HTTP and others) - LumiSoft.Net http://www.lumisoft.ee/lsWWW/download/downloads/Net/LumiSoft.Net.zip
Here is the link to the help index for that library http://www.lumisoft.ee/lswww/download/downloads/Net/Help/. Exciting!
It's open source (C# .NET) and completly free for modifing and using in commercial projects. Wonderfull, many thanks to it's author!
So, I was engaged in using this library in Dynamics NAV.

First of all, this library should be compiled as COM Automation object. For this possibility:
1) COM Interop on the project tab should be checked.
2) Special attributes for COM sharing should be appointed for the classes:
[ComVisible(true), ClassInterface(ClassInterfaceType.AutoDual),Guid(" ... ")]
Namespace System.Runtime.InteropServices should be used.
3) GUID for assembly should be appointed:
[assembly: Guid(" ... ")]
4) some classes should be redesigned (for example, static members are not visible in COM)

If Guids are not appointed that way, the linker automatically creates it, but every time you making changes in the source code you would have new Guids. It's too difficult for parallel NAV debugging, because C\AL variables are droped after new COM server is registered. The description "Unknown Automation Server.Unknown Class" is shown in that case.
I used special tool for Guid creation (Tools - Create Guid in Visual Studio).

In Dynamics NAV I've created a pair of simple tables (Message and Mailbox). Message have a table relation to Mailbox: