Wednesday, January 31, 2007

Bug in NAV 4 SP3 BG

I found and fixed a bug in the localized version og Dynamics NAV 4 SP 3. Actually one of our clients found the bug:). It would not be that interesting if the bug was not so obvious. Besides it is in one of the most used NAV functionalities - item charges in sales module. Everythings seems fine - the charges are splitted correctly on the screen, but when posted, the charge is whole charge is applied to each line. Today I will report it to Microsoft.
Posted by gregory in 07:36:47 | Permalink | Comments (1) »

Tuesday, January 30, 2007

Interfacing Navision

Dataports are a very nice functionality of Navision. They really help developers when import of text files is needed. However, manual running of dataports make interfacing with other systems semi-automatic. You should have the text files, ensure that they are the right files, import them in Navision and proceed with data processing in the system.

You can always design a form which run dataports on specified time intervals. The cons of this method is that you should keep a GUI session running and logged all the time.

Next method is using timers again. But it is via Navision Application Server. This is a non-GUI windows service. NAS is the intelligent way of running independent, time consuming, non-GUI batch jobs. However, a person should be appointed to monitor the service and the Event Viewer.

The most hi-tech interfacing decision is MSMQ. You can transfer your data via message queues. Navision message queue bus adapter is a COM object and an event is triggered every time a message is received. This means that you can capture data automatically from other systems in online regime. The problem is that you are getting just a byte stream and you should find a way to process it. The best decision for me would be if I could pass the byte stream to a dataport. I do not think it is possible yet.

I must not forget XMLports. These are xml dataports. I tested them a little bit but there are some things that I do not understand. They can not be started from Object Designer. They must be instanced and run programmatically. The other thing is that I could not find a way to pass additional data beside the fields from the tables referenced.

Posted by gregory in 08:12:07 | Permalink | No Comments »

Friday, January 26, 2007

Data Mining

Yesterday I made some tests with the Analysis Reports in Sales module in Dynamics NAV 4. The designed report was quite simple, but still it provided quite a lot information. It contained only one row with all items sold. There were seven columns per each day of the week that show the quantity sold per day. Besisdes there was an analysis view that defines quantity sold by three dimensions - region of sales, item type and item brand. So, only for 15 minutes I designed a report that could show me the quantity sold for each branch of the company, for each brand and each item type. I could even dig to a specific item. And the best part of it is that there are some bar charts that visualize the results. There were some bugs like not a full refreshing of data. However I’m quite satisfied with this new functionality of NAV.

Posted by gregory in 09:20:12 | Permalink | No Comments »

Thursday, January 11, 2007

Hard days

There is one particular moment of the IS implementation project that I hate mostly. It is 1-2 weeks after the go-live when the system is running smoothly, all major flaws are caughted and corrected and the users have absolutely irritating requirements about the presentation of things - different order of fields, different labels, staff like that. When someone’s debugging or just concentrating on something important, it’s totally annoying to disturb him with request to maka e label bolded in order to be seen better. The only recipe I know for this moment is giving my best to finish this period as fast as I can.
Posted by gregory in 16:36:09 | Permalink | No Comments »

Tuesday, January 9, 2007

Convergence 2007

I’m going to San Diego in March for Convergence 2007. It’s an enormous Microsoft ebent about the Dynamics products. In professional terms this means that I’ll learn a lot of new things about the new developmets in the products,to meet new partners and clients.

Personally it is a great opportunity for me to go to USA, to fly over the ocean and to see the other ocean.

I’m planning large blog posts from the Convergence, so keep visiting the blog next months.

Posted by gregory in 08:46:29 | Permalink | No Comments »

Wednesday, December 20, 2006

Roundings in Navision

Rounding is essential for precise calculations in Navision. According to bulgarian law and tradiotions, amounts are rounded to 0.01. Unit amounts are rounded to 0.00001 in most of the implementations that i have seen. However this generate some differences in average cost adjustment. Immagine that we have 10 units with total cost of 12.93. We sell 1 piece and then make negative adjustment of 1 piece. The total cost of the first piece is Round((12.93 / 10) * 1,0.01), which is 1.29. Hence the unit cost of the piece is 1.29000. When calculating the negative adjustment cost the system takes the remaining amount which is 12.93 - 1.29=11.64. Then the unit cost is 11.64/9=1.29333… Theoretically the cost of the sold item and the adjusted items should be the same. Practically it is impossible because of the rounding.

One year ago I had a problem with banker’s rounding in Microsoft products. Banker’s rounding is when 1.45 is rounded to 1.4 and 1.55 is rounded to 1.6. It depends on what is the previous digit - odd or even. In .NET 1.0 or 1.1(I do not remember) the Math.Round function can make only banker’s rounding. It was kind of stupid because all other Microsoft products (i.e.Excel) make normal(mathematical) rounding. So if you calculate something using .NET and check it in Excel it could be different.

According to my experience it’s not a good idea to transfer unit prices with VAT to other system and receive unit prices without VAT in the same time. Immagine a unit price of 1(incl. VAT). Then the unit price without VAT is 0.8333… No matter what is the rounding in the other system or in Navision, there is always a quantity, that will cause a discrepancy. For example, the other system rounds the unit price to 0.833. There is an invoice for 10000. Then the system will calculate 0.833 * 10000=8330. The total amount icl. VAT will be 8330 * 1.2=9996. The difference is 4 in this example.

So be careful with roundings and always think of them. 

Posted by gregory in 09:48:40 | Permalink | No Comments »

Friday, December 8, 2006

Good programming

For the first time I’m very proud how ordered is my code. I made some customizations for NAV 4 SP2 and just 2 hours ago I downloaded the new NAV 4 SP3 and install it. For my current project I’m keeping a log of all changes and comment every piece of code that I add or change. I unistalled SP2, installed SP3 and converted the database for less than 2 hours. That’s one small step in the programming best practices and a giant leap for me.
Posted by gregory in 14:28:13 | Permalink | No Comments »

Thursday, November 23, 2006

Dynamics NAV filters

I’m mad about the filters. I spent a whole day looking where is the filter of the Sales Header in the Orders form. Neither GETFILTERS nor GETVIEW show any result. Then I found it. The filter is set ut in the SourceTableView property of the form, so it is automatically put in the 2 filter group. So if I want to obtain such filters I must set the filter group at first and then use GETFILTERS. Still there is something that is not quite clear to me.

Here is the normal usage of filter groups using SETFILTER:
FILTERGROUP(2);
SETFILTER(“Location Code”,’MyLocation’);
FILTERGROUP(0); 

However the working equivalent of this using SETVIEW is:
SETVIEW(’where(Location Code=FILTER(MyLocation))’);
FILTERGROUP(2);

I’m still wondering why is this so or it’s just a side effect.

Posted by gregory in 15:40:50 | Permalink | No Comments »

Wednesday, November 15, 2006

Dynamics NAV 5

I’ve just watched a presentation from TechEd regarding Dynamics NAV 5 and I’m quite excited of what I’ve seen. The client looks very modern and useful. The architecture is 3-tier, based on services and web services. There is some integration with Visual Studio. The only thing that I dislike is that we’ll continue to use C/SIDE and C/AL. They will be transformed in C# somehow and will be compiled in dlls.

I’m not sure how Microsoft will cope with this because it seems like a lot of effort in very short period of time. If it is a stable version it will be a bestseller in the next two years.

Posted by gregory in 13:52:04 | Permalink | No Comments »

Thursday, November 9, 2006

A “system” thinking

I’m posting this under the Dynamics NAV 4 tag although it covers a general issue of information system implementation.

A very common problem of an IS implementation is that people expect to do the things that they do in the same way after the IS implementation. Generally it is impossible because the IS is a computer system after all. This means that it executes business processes as algorithms and thus regulates the data flow. Executing business processes as algorithms means that there are clear mathematical and logical rules that tell the system what to happen. In real life, however, the rules are not that strict and sometimes are missing. Mapping of the real life to the system functions causes a conflict.

I haven’t heard of a best practice how to clear the conflict. The best way according to me is to make and push people think in a more “systematic” way (to think like computer). Then comes the moment when they realize that it’s better now:) The problem is how long does it take to happen:)

Posted by gregory in 16:26:05 | Permalink | No Comments »