The Art Of Nav – NAV 5.00SP1 Stats

Today I made some statistics about NAV 5.00SP1 tables. I know that the stats have no purpose, but you can see on them how complex the system is. It can help to someone, who just want to know, how much is something used in standard etc. There are the tables:

Tab 1) Field relations by type:

Relation Type

Count

AVERAGE

5

COUNT

109

EXIST

135

LOOKUP

291

MAX

9

MIN

14

SUM

415

-SUM

70

TABLEREL

5468

-EXIST

1

Grand Total

6517

 

A you can see, there is 6517 relations between fields (TableRel, SUM, Lookup etc.) or tables (Exist, Count). Of course, most of them are table relations and SUM flowfields.

 

Tab 2) Field data types:

Data type

Count

Code

6377

Decimal

2984

Text

2310

Integer

1603

Boolean

1452

Option

1279

Date

1025

Time

127

DateFormula

101

DateTime

57

BLOB

48

GUID

17

RecordID

6

Duration

2

TableFilter

1

BigInteger

1

Grand Total

17390

 

From this table you see that most used data type is Code – of course, because most of relations are made through some code and the code fields are used everywhere... :-) Second is Decimal – yes, we are working with ERP which counts money, inventory...

Tab 3) Field data types including length:

Filed type and length

Count

Code10

3387

Decimal

2984

Code20

2871

Integer

1603

Boolean

1452

Option

1279

Date

1025

Text50

973

Text30

672

Text80

253

Text250

188

Time

127

DateFormula

101

Text20

87

DateTime

57

BLOB

48

Text10

39

Code30

35

Code3

21

Text100

20

Code250

19

Code50

17

Code100

17

GUID

17

Text65

16

Text64

8

Text38

7

Text200

6

Text249

6

RecordID224

6

Text5

6

Code80

5

Text119

4

Text70

3

Text99

2

Text90

2

Text19

2

Text150

2

Text199

2

Code130

2

Duration

2

BigInteger

1

Text7

1

Text127

1

Text3

1

Text14

1

Text151

1

Text63

1

Code2

1

Text131

1

Text220

1

Code98

1

Code1

1

TableFilter

1

Text118

1

Text149

1

Text31

1

Text32

1

Grand Total

17390

 

Most used is Code with length 10 – all basic lists are referred by this data type. But newer the longer fields are used (Code 20), which have enough space for possible longer codes. I personally when I create new table, I use the Code 20 to precede possible problems with additional extension of the field in future. Very interesting are field length at the end of the table like Text118, Code1, Text63... ;-)

Tab 4) Overall stats:

Tables

918

Fields

17390

Fields per table (Avg)

18,94

Average count of relations per table

7,099

Percentage of fields referring other fields

37,47%

Max fields in table

176 (Tab 39 - Purchase Line)

175 (Tab 27 - Item)

Max table relations per table (All)

93 (Tab 18 - Customer)

Max table relations per table (Table Rel)

66 (Tab 81 - Gen. Journal Line)

Max table relations per table (FlowFields)

63 (Tab 18 - Customer)

Most referred table

266 (Tab 349 - Dimension Value)

258 (Tab 308 - No. Series)

235 (Tab 15 - G/L Account)

 

I think that the last table doesn't need any explanation. In average, if you change some field's length, there is more than 1:2 chances that you need to change length of another field which refer to the first field.

 

I hope, that you made better picture of the complexity of whole Microsoft Dynamics NAV system. May be that you now understand, why the people around this system needs long time to gather enough experiences to understand the system. It is why the NAV is so great product, because regardless this complexity, it is easy to change and develop additional parts. Do not forget that these stats are just for the basic version of the system. If you add all addons which customer needs for his work, these stats can go much higher...

I want to congratulate to all consultants and developers, which are able to understand the system, which knows, how it works, and which are able to correctly do their every-day work with this huge amount of information. May be that this stats will help customers to understands, why sometimes there are some bugs in the system, why some things needs more time to think them out than making them.

We will see how these stats will change with new versions.

Posted by kine | with no comments

The Art Of Nav – Big Picture of NAV

Today I have for you something, what everyone wants to have, but it was nearly impossible to create. After you see it, you will know why. I prepared it for you in more formats. You can look at it as PNG file, you can walk through it with some VRML viewer, you can open it as Visio file. You can read it and import it as CSV file. You can browse it as HTML file. You can view it as SVG file. It is on you, how you will visualize the result. I must say, I have tried many ways, but in most cases the tools were weak and my 2GB of RAM was not enough.

The Big Picture Of NAV

What's the hell is this "line hell"?

Ladies and Gentleman,

"Big Picture of NAV" is there. You can download the files on the "The Art of NAV" project page. And what the files are about? The files are generated from data, describing ALL NAV TABLE RELATIONS WITH CONDITIONS AND FILTERS. In the visualizations, the tables are represented by boxes where first line is table name and rest are all fields in the table. The relation descriptions are part of the edge text (source conditions, target filters). All is based on NAV 5.00SP1 W1 objects. When you take the result files and you will want to print it in 1:1 scale, the output will be over 5x5 meters in size. Visio cannot save the diagram as bitmap for 1:1 scale (it seems because the size). You cannot see whole diagram in Visio (on common display resolution), because zoom cannot be less than 1%. My computer had problems to generate any graph from the sources. My 3GHz Core 2 DUO worked on it many minutes. I have used the excellent software Graphviz to make the graphs, but as you can see, it is too much for any tool on the world to make some nice readable chart (or I didn't find the correct settings :-)).

I prepared for you NAV objects, which I used to extract the relations from object text file. It will fill the NAV table with all necessary data and you can browse it in prepared window. You have list of all fields in the database on top, related tables for selected field in middle, and fields relating to the selected field on bottom. You need to use these objects on the database, from which the object file is created, because the form is based on the virtual tables of the database. The objects are extracting 100% of relations in the database, which are defined. You can use them to extract relations from you own databases. Just export all tables as text and run this tool in the same database.

All files can be found in the download section of project "The Art of NAV".

Do you understand now, why we do not have any official diagram with the NAV table structure? :-D

File description and viewers I tested:

SVG – vector format – ZGRViewer – sometime needs to set bigger java heap by adding parameter "-Xmx512m" (the size is on you, this example is 512MB) when calling the java package

HTML – HTML exported from MS Visio – Internet Explorer – use the Internet explorer, you can search within the graph. Firefox is showing just plain bitmap.

VRML – the graph in 3D world – FLUX Player – needs big memory, you can look at the graph in 3D space and if you use the FLUX studio, you can add cameras, interactivity, animations etc. Welcome into "NAV Space".

VSD – MS Visio file created by importing the SVG file – MS Visio – You can look at the graph in Visio and print it from there (over 5x5 meters). Hart to edit etc. because the size and SVG source limitations...

Posted by kine | with no comments

Where to place my code?

That's the question… Many rookies have problems with decision where to put the code (or from where to call it). When you watch some beginner in NAV where the code is placed and from where it is called, you can find out that in many cases used triggers are the triggers, which in 99% are not used in the application and many Pro developers nearly do not know what the triggers are doing :-).

I had a thought. To create small decision tree which can help developers to find out, which trigger will be best for calling the code, and where to place the code in (table, codeunit etc.). I placed the first file to google code repository site under project named "The Art of NAV". I will try to keep this site as the Home page of this project. We will see, maybe I will find better tool for that.

I am waiting for your opinions and comment. I will try to keep the project live and up to date. We will see, if it helps you.

This is a first step I am doing and I am thinking about it as an initial step for something I am calling "NAV Art" or "The Art of NAV". My target is to help all developers to make the code as clear as possible and make some order in the NAV word. Of course, there is no simple manual or something for that, but I want to open some discussion about that and give some ways for the specific problems. I hope that I am not alone in that and you all will try to participate in this.

I am Waiting for your comments...

Decision tree

Decision tree for table

Pay attention to permissions when upgrading DB from SQL 2000 to SQL 2005

Story

Today I solved one "mystery" which leads to data loss. But from the beginning...

We have upgraded HW and MS SQL to version 2005 on 64bit platform. Everything without problems, because SAN was used, transferring the DB was just Detach/Attach and running one SSIS task to transfer user logins. No problem. After upgrade all is working without problems. But...

Some users started to complain that specific functionality is not working correctly. What's going on?

From one card you can open another form through button. This form shows some related records, and if there are no related records, they are generated. It's simple. But now, user opens the form and there is nothing in it. I tested it and it works ok, records were created. Ok, I have something to think about and something to solve.

After few rounds of "you'll try it, I'll try it" we noticed, that when the user open the form, there is just one line in the form, looking as inserted (no asterisk on left side of the table). But after we moved cursor or just opened table filters and returned back, there is no record in the table and we are on the new line. 8-|

Ok, code looks correctly, no conditions or something else preventing the record insertion process. I started client monitor and there are all the inserts statements, but still no records in the table.

I will not go deep into the analysis of this problem, if you are interested in what I did to discover the source of the problem, post comment and maybe I will wrote another article about that. Now, I will jump to the time, when I found out what's the problem.

As everytime, the SQL Profiler helped to discover the problem. In profiler I enabled the tracing of Server errors and exceptions and after I catched the process, I saw few red lines saying this:

Exception 74 Error: 262, Severity: 14, State: 4

User Error Message 74 SHOWPLAN permission denied in database 'blablabla'.

Ok, it confirmed one thing I noticed at very beginning – if you are db_owner, it is working. If not, you have the problem. After looking into permissions and comparing the permissions from DB created on SQL 2005 and on the transfered one, I found out that there are no Database permissions "Show Plan" and "References" for the application role $ndo$shadow.

Result

Why they are not there? Because these permissions doesn't exists in MS SQL 2000. They are assigned correctly when you create the DB on MS SQL 2005, but not when you transfer the database by Detach/Attach or Backup/Restore process. These permissions are not created even when running Synchronize all process from within NAV (using Standard security model of course).

Another thing I noticed is that this bug makes visible problems only if you are working with Maximized NAV windows, if you are working with form in normal size, all seems to work correctly.

Conclusion

After upgrading MS SQL 2000 to MS SQL 2005, if you are not creating new DB but using Detach/Attach or SQL Backup/Restore process to transfer the database, you need to grant "Show Plan" and "References" permissions for the application role "$ndo$shadow" on the database. Do not forget this else you can experience mysterious data lost and behavior.

Details of the bug

The data are generated in OnRun trigger of the second form. After this trigger is finished, the first form started to be updated, because the OnAfterGetCurrRecord trigger of this first form is called and there is CurrForm.UPDATECONTROLS command in it. Because this process is still running in context of the transaction started with the OnRun trigger of second form, and because there are SHOW PLAN statements in it and the SHOW PLAN permissions are not granted to the app. role, SQL server raise exception "permission denied" and the transaction is rolled back. But NAV client doesn't catch this exception, and this is the main problem. The first form refresh process is not started if you do not have maximized forms. But the permission exception is triggered every time the forms are using internally COUNTAPPROX to read expected record count (may be because the scrollbar size?) and these calls are canceled by this. User does not know anything about this permission error...

This bug is rare to experience, but the permissions problems can be source of another bug which is not so easy to find or even notice it.

Repro steps

  1. Create new DB on MS SQL 2005, restore Cronus DB into it
  2. Remove "Show Plan" permissions from $ndo$shadow app. role on the DB. (or you can detach come cronus database from MS SQL 2000 and attach it in MS SQL 2005 - the permissions will not be there, because they are not exist in MS SQL 2000)
  3. Import attached objects
  4. Run form 90001, maximize it (this bug makes a problem only when the windows are maximized!)
  5. Click "Test - Run Form"
  6. Second window will open (maximized) but the window has no entries (or just one, until you open filter window or move the cursor, after that there are no lines in the form)
  7. Restore the windows size, close the window opened in step 6
  8. On restored window (not maximized) click again "Test - Run Form"
  9. Second window will open but this time with entered entries - it means correctly.
Objects for download
Posted by kine | with no comments

Country code in ENU fin.stx file is no longer W1

You know the situation: customer has W1 license (or another country license) but is using client for his "home" country. E.g. license is W1, but because Company is in Czech, they are using Czech client. Not problem until NAV 4.00SP3 Update 6. When you got error that "The country code in the license file does not correspond to the country code (XX) in the stx file", you just took the fin.stx from ENU folder and copied it into Client folder. You were done.

But not now. If you installed Update 6, you can find out that this replacement will not solve that problem. Why? The country code in the fin.stx in ENU folder is not W1 anymore if you installed localized version of NAV client. It means you still need to install the same country NAV client like the license Country code and take the fin.stx from there. Who is responsible for that??? I will try why this change was done.

The error is reisen when:

  1. You are using C/Front
  2. You import the license into client folder and run the client
  3. May be when you are using N/ODBC (I didn't test it)

Solution for all points is to take fin.stx from correct language version of client installation (same as the country of license) and copying them into the client folder. Another solution is to install same language version like license country code and just take and add the language code subfolder you want to run client in. If you do not have these files, in case of C/Front you can do small workaround: take the fin.stx, open it in Notepad, find the text string "00200-00001-002-1" and change the country code to same as in your license file. It will corrupt the fin.stx seal, but C/Front is not checking it (client will tell you that fin.stx was corrupted). But better than nothing.

 I hope that it will help you quickly solve your problems, because for me it was one additional night on customer site to solve this "little"problem.

Official Microsoft Dynamics NAV Blog

 Today was opened new official blog of Microsoft Dynamics NAV team. You can visit it there: http://blogs.msdn.com/nav/ . I hope, that we will see there some about future releases and other things around NAV team. We will see in next months, what the blog team prepared for us. But for now - "welcome NAV team into world of bloging".

Posted by kine | 2 comment(s)
Filed under: ,

Powerfull command in Microsoft Dynamics NAV: BEEP

Last few weeks I have worked on some project, which needed to use SendKeys to do something with NAV client. During developing this module I hade problem, how to synchronize of calling SendKeys with behaviour of the NAV client. You know, you send keys to the NAV, client is opening some window (form), it took some time, and as result the keys are sent to incorrect window. I tried to use Timer to synchronize it (wait for opening the window etc.), but it didn't work. The keys still ended in queue of another window that I wanted.

Once, I added BEEP(440,100) command into the timer when I sent the keys to know, when the event was fired and when the keys were sent into queue. And I wonder - the keys ended in correct window! I found out, that when you send some key sequence, which is opening e.g. File Save dialog, you need to wait for the dialog to open to send e.g. keys to "write" the file name into this dialog. And BEEP will help you with that. Because BEEP needs to talk with Operating system, it somehow "give" the control to OS. When you connect this with Timer event, you can do this:

1) Set timer (e.g. each 100ms), enable it

2) When the OnTimer is called first time, send first key sequence, which open the window

3) Call BEEP after sending the keys

4) In next call of OnTimer send second key sequence

5) Call BEEP after sending  the keys

6) repat the steps through all windows and keys you want to send.

7) In last OnTimer, disable the timer

 

Because you used the BEEP command, each new key sequence will end in correct window, because the beep will be called right after all the keys are processed and NAV is free for processing next command. If you use this without BEEP, all keys will be send "to fast" and will be processed in incorrect windows (may be yes, may be no...).

And if you do not want to listen the beep sound, just set the frequency to 1Hz (0Hz is not working, it just skip the command). I found out, that time of the BEEP must be over 10ms, else it will not the effect. But it seems that the value can vary between computers.

I know, that you will be able now to do the cool things with NAV (e.g. automatic version controling :-)) now, when you know how to use BEEP command to synchronize SendKeys with client. 

Take this as result of my research. I do not know exactly why the beep is working like this, but you must know, that IT IS WORKING (for me and my collegues)! 

 (tested on version 4.00SP3 and 5.0)

Have a fun with your new powerfull command BEEP!Geeked Yes

Posted by kine | 10 comment(s)

The Style Sheet Tool for Microsoft Dynamics NAV

 Microsoft has released the tool fro creating Word Stylesheets for Microsoft Dynamics NAV 5.0. You can download it from PartnerSource here. It includes one FOB file with new objects, which are used to define the stylesheets, and documentation.

 

The process of creating styleheet is very easy: you create new card for the styleheet, where in header you define the base table and in lines you define all used tables, fields you want to export and relations between tables (e.g. Sales Header and Sales Lines). After that, you can create Mail Merge document, where you can create the text, formating etc. using the Mail merge fields with all the fields you defined in NAV (you can use Work Date too...). After closing the document, NAV will import it back and will try to transform it into StyleSheet. After that, you can use this stylesheet for exporting data from the base table. Easy, isn't it?

 

Of course, the tools can have some bugs, do not forget that it is the first version. 

Posted by kine | with no comments

Microsoft Dynamics NAV 5.0 Beta available for download

I found this info on this Microsoft Dynamics NAV UK Blog. The download is accessible on the PartnerSource there. You have two possibility for download: VPC for demo, with installed Office 2007 and NAV 5.0 redy for usage, or you can download the install files.
Posted by kine | 7 comment(s)
Filed under: ,

NAV 5.0 just for Group 1 countries?

Based on MS info the NAV 5.0 will be localized and released just for countries in Group 1. For other countries only the NAV 5.1 (including NAV 5.0) will be released!

 This is big disappointment for me, because it means that all companies in Gr2 and Gr3 will have new version one year after Gr1. This market will be one year behind others and partners will have difficulties with managing that. It will be hard to explain to customer that the version we were talking about that will be released in 2007 will be one year later. I recommend to all who are in Gr2 and Gr3 to use WW1 version for preparing their products for the next version. But yes, this means BIG OUTRAGE for all of us outside the Gr1 countries. MS wants to save money? Or it is too big job for them to localize two versions in one year? (but it is not really localization of two versions, 5.1 is still 5.0 + new client. It means, if 5.0 is localized, just few things must be localized for 5.1). Nobody knows, but it seems that this decision was made and there is no way back...Angry

 
 UPDATE (27.1.2007): It seems like Gr1 and part of Gr2 will be localized. On the NAV 5.0 release page are prepared links for these countries:

AT - Austria GR2B
AU - Australia GR1
BE - Belgium GR2B
CA - Canada GR1
CH - Switzerland GR2C
DE - Germany GR1
DK - Denmark GR1
ES - Spain GR1
FR - France GR1
IE - Ireland GR1
IT - Italy GR1
NL - Netherlands GR1
NO - Norway GR2A
NZ - New Zealand GR1
SE - Sweden GR2A
UK - United Kingdom GR1
US - United States GR1
we will see...

 

Posted by kine | 11 comment(s)
Filed under: ,

NAV 5.0 Preview - Part 3 - Export to external application

Today I will try to show you one new cool feature of NAV 5.0 for end-users. NAV 5.0 is able to export any form into XML and using XSLT (template, stylesheet, transformation - you can name it in different ways) can be this XML transformed into another XML. And because MS Word and MS Excel is able to open documents defined in XML, you can create Word and Excel documents in this way (and for any other application).

How it is working

On the toolbar there are three new shortcuts, which can be used in any time when you have some form opened (Last three shortcuts on the picture, behind the watermark).

NAV 5.0 Toolbar

For example, when you open the G/L Account card, and you click on the first shortcut (Word), you will get the Word document with all data accessible on the G/L Account card.

NAV 5.0 G/L Account cardNAV 5.0 MS Word document with G/L Account card

In this Word document, there are all tabs from the form and all controls from these tabs. If you use the second shortcut (Excel), you will get slightly different result:

NAV 5.0 G/L Account exported to Excel

Each tab has own Sheet, but there are same data like in the MS Word. In both applications you can open the original NAV form through clicking on the title in exported document. It means that this document is still "linked" with the original and you don't need to search in NAV for the original form and record.

This was example of using defualt template, which is usable for all forms. But you can attach new templates for specific NAV form and than the user can select this template for exporting within template selection form (third shortcut). In the demo DB there are templates for Customer letter (on Customer card), Contact letter (on Contact card), Vendor letter (on Vendor card) and Sales Quote (on Sales quote card) and Sales Order Confirmation (on Sales order card).

NAV 5.0 Customer letter in MS WordNAV 5.0 Sales Order confirmation in MS Word

You can see that the result can include additional data that are not part of the form in NAV (e.g. Company name, Payment terms description etc.). It means that the result can be complex and you do not need to include all data on the form just because you need to export it.

What is behind

From designer point of view is this feature very complex. Developer needs to understand XML, XSLT and target application XML. If you want to customize this feature, you have two possibilities. You can change the functions in CU1 which are used for this export (you can change how it transforms the data, which template is selected etc.), or you can modify or create own XSLT template (you can change the result of the transformation).NAV 5.0 CU1 new functions
 

 In the functions, when exporting some form, the XML with description of this form is passed into function which will apply the transformation from selected XSLT template, and the result is sent into the application itself. On the screenshot of the Data XML (the XML describing the form) you can see that all controls are included with some informations. From position or size is there just the width of the control (if you change width of column on the form, the excel column in exported document will have similar width)

.NAV 5.0 Form data XML

In the example there are data from Sales order card form. There is header tab control, line subform, Info panel frame etc. This XML file than can be transformed through XSLT file. Result of this transformation can look like this:

 NAV 5.0 resulting Word XML document

On the screenshot is part of the Sales quote XSLT used to transform the XML data into MS Word XML file:

NAV 5.0 Sales quote XSLT 

In the stylesheet you can include other data from NAV into the result (Object/ResponsibilityCenter/Name, Object/CompanyInfo/Name) without being part of the source XML file describing the form. I do not know more info about that (I have no access to this new codeunit yet) but if you can include any data from NAV, this will be very cool tool for creating exports. 

After you prepared some XSLT template, you can import the template into NAV through Stylesheet setup form. You need to select the xslt file, for which application the stylesheet is prepared (which app will be launched, you can add your own), the description and if the template is for all forms or just for selected (depends on which option is selected on the setup card when you run the import).

NAV 5.0 Stylesheet setup formNAV 5.0 Stylesheet setup form

One bigges issue I have with that is, that I am not able to find any user-frendly tool for creating the stylesheet in some visual way (I am novice in XSLT and XML things...). And second thing is that the logo bitmap is part of the stylesheet and it means that you need to customize the stylesheet for each customer. And because I have no good tool  for XSLT, I do not know how I can replace the bitmap in the stylesheet...

 I hope that after documentation for NAV 5.0 is released, I will have more info to be able to create own stylesheet and to work with that like with C/AL and that customization of XSLT will be easy for me.

 

I do not know what will be in next part now.
 

 All screenshots you can find in fullsize in my library at http://msmvps.com/photos/kine

Posted by kine | 20 comment(s)
Filed under: ,

NAV 5.0 Preview - Part 2 - Links

In this part I will describe the new possibility to attach any URL to any record in database. This can be very usefull for connecting the word of documents with data in ERP. There are tools for managing these links through C/AL code (see previous part, the rec.ADDLINK command etc.)

 How it is working

At first, there is new shortcut on the toolbar (Clip). NAV 5.0 Toolbar

Through this shortcut, any user can open form, where you can enter the URL you want (HTTP, Sharepoint, local filesystem, network filesystem, anything you want). From same form you can open attached URL. Count of the atached links is not limited, length of URL can be max.  1000 chars. NAV 5.0 Related links form

For example, you can add scanned Invoice to your purchase order and when the order is posted, the attached links will be copied to Posted Invoice. All users can easilly find and open the document without searching through folders with thousends of files. User can recognize that on actual record are some links in status bar, where is new flag "LINK" near the "FILTER" flag.

NAV 5.0 part of Statusbar

 What is behind

For saving the links new virtual table is used (2000000068 - Record Link). NAV 5.0 Virtual tables

NAV 5.0 Record Link table

As you can see, links are numbered and related to the record through RecordID. Long URLs are splited into 4 fields, with possibility to enter 250 chars of description. The type and BLOB is not used yet, in my opinion the type "Note" and the BLOB "Note" is prepared for version 5.1 for the Work-flow notes. The links can be added, deleted and copied through C/AL commands.

 

That's all. It is easy but smart solution. I know that many partners used similar way for attaching the documents, but this solution is much better, because you do not need any change in C/AL code and you can attach the document to any record without customization.

 

Next part will be about possibility to export any form into Word or Excel and possibility to create templates for this export.

Posted by kine | 41 comment(s)
Filed under: ,

NAV 5.0 Preview - Part 1 - The C/AL

In this article, I will describe you what is new in C/AL and C/Side in Microsoft Dynamics NAV 5.0. It will be brief, but I do not like long texts about nothing. Let's go!

New C/AL keywords:

  • COMMANDLINE  - Use this function to return a list of the parameters used to start Microsoft Dynamics NAV . The command will return something like "database=xyzco,id=NAV50,NTauthentication=0" - it means all parameters used when starting NAV client.
  • APPLICATIONPATH - Use this function to return the path to the directory where the executable file for Microsoft Dynamics NAV is installed. MAX 255 chars!!!
  • TEMPORARYPATH - Use this function to return the path to the directory where the temporary file for Microsoft Dynamics NAV is installed.
  • ISSERVICETIER - Use this function to find out whether the code you are executing is running on the new Dynamic NAV three-tier architecture or on the old two-tier architectureThis is the first command connected with NAV 5.1 three-tier architecture!
  • VARIABLEACTIVE (Automation) - Use this function to determine if a variable, such as field or a control, is active or inactive. I personally have no idea when I will need that. I am using ISCLEAR now. But may be in the  future...
  • [Ok :=] UPLOADINTOSTREAM(DialogTitle, FromFolder, FromFilter, FromFile, NVInStream) - Not described in on-line help yet. In my opinion it is function prepared for NAV 5.1, for service tier to be able to transfer files between client PC and service-tier (local file for service tier is not anymore local file for client, this will be used in connection with ISSERVICETIER command).
  • [Ok :=] DOWNLOADFROMSTREAM(NVInStream, DialogTitle, ToFolder, ToFilter, ToFile) - see UPLOADINTOSTREAM
  • [Ok :=] UPLOAD(DialogTitle, FromFolder, FromFilter, FromFile, ToFile) - see UPLOADINTOSTREAM
  • [Ok :=] DOWNLOAD(FromFile, DialogTitle, ToFolder, ToFilter, ToFile) - see UPLOADINTOSTREAM
  • KEYGROUPENABLE(Groupname) - Use this function to enable a key group. - Yes, now you can enable and disable keygroups through C/AL code.E.g. you can use it in report running once per year, which need some special keys to run faster.
  • KEYGROUPDISABLE(Groupname) - Use this function to disable a key group.
  • KEYGROUPENABLED(Groupname) - Use this function to check whether or not a specific key group is enabled.
  • GETLASTERRORTEXT - Use this function to return the text that was contained in the last error message displayed by the system. Coolest new command in version 5.0 for me! Now, you are able to find which error was called when calling codeunit in IF-THEN statement! Used for example when running Cost Adjustment batch to prevent stopping the batch on first error! Now the job continues after the error and you see the error in the report!
  • CLEARLASTERROR - Use this function to remove the last error message from memory.
  • [ID] := Rec.ADDLINK(URL[, Description]) - Use this function to add a link to a record. Connected to the new Link functionality in v5.0. You are able to add any URL to any record in NAV. User can see the URLs and can easily open the documents. I will describe this module in some upcomming part.
  • Rec.DELETELINK(ID) - Use this function to delete a link that has been added to a record in a table.
  • Rec.DELETELINKS - Use this function to delete all of the links that have been added to a record.
  • Rec.COPYLINKS(FromRecord) - Use this function to copy all the links from a particular record.
  • Ok := Rec.HASLINKS - Use this function to find out whether or not a record contains any links.

This is the list of all new commands I found in the NAV v5.0 for now. I hope, that you are excited to see some commands from this list. The text is copied from On-line C/AL help available with this beta version.

 

New features in C/SIDE

 

New Properties

  • Form.SourceTableTemporary(Yes/No) - No description - if set to Yes, Rec will be temporary table! You do not need to modify OnFindRecord and OnNextRecord anymore!
  • Form.LinksAllowed - settings connected to the new Link functionality, which can be disabled per form...

Indenting

  • For all C/AL developers - now you can indent whole block of code just with selecting the lines and pressing Tab key (or Shift+Tab to unindent)!

This is what I found in this Beta version for now. May be there are some new things which are still hidden for me, but what I found I found as usefull. I hope that you as well.

 

Do not hesitate and share your thought about these new things! I am looking forward your comments!

 

I do not know, what will be in next Part of the preview yet, may be something about the Link functionality.

Posted by kine | 5 comment(s)
Filed under: ,

NAV 5.0 Preview - Part 0

Hello everybody!

 Because I received DVD with VPC image with Microsoft Dynamics NAV 5.0 Beta version as part of MVP program, I will be able to give you some preview of new things in this version. I will try to show you screenshots and descriptions of cool things which are prepared for you. Please, do not hesitate and write your reaction into post comments! I want to know if you are looking for the version or not, if you will like the features or not and everything what comes to your mind during reading the articles! (in generally, I do not know why there are no reactions on all NAV blogs. It is common to comment articles on blogs, but not on NAV blogs...)

 
I hope, that first part, about news in C/AL code, will be ready for you today...

 

 

Posted by kine | 2 comment(s)
Filed under: ,

The description for Event ID ( nnnnn ) in Source ( XXXXX ) cannot be found

Everybody who worked with Navision Application Server or NAV client or Navision Database Server knows that text from their event log. Now, I can show you how to clear this text from your event log.

  1. Some info about how the Event log is displaying the messages:
  • Events in event log are just set of attributes and texts. Event log viewer is able to take these attributes and send it to the application which generate it for "translation" (for example, application can add some useful information for the user…). To be able to send it to the application, the event log viewer must know the library, which is responsible for translating the message. Of course, this is written in the registry (I will show you where… ;-)
  • Because previous point, the resultant text depends on computer, where you are viewing it. When you view event log from exchange server on PC with Windows XP, event viewer will not know anything about exchange and will show you the information "The description for Event ID ( nnnnn ) in Source ( XXXXX ) cannot be found…". Same thing will happen with NAS messages…
  1. You can found that all services for NAS registered through command prompt (installasservice) are not including this text in their messages. Just service registered through installation process have this "problem".
  2. To know more, you need to look into this registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application. You can see, that there are keys for all services, which are registered in Windows. In each key are two or more values. The main two are EventMessageFile and TypesSupported. First one is text and it is the path and filename of the library responsible for the "translation", second one is just some attribute. If the reg key for the service code saved in the Source field of the message is not existing, the event log will include the text:

     

    The description for Event ID ( XXXXX ) in Source ( <Service name> ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event:

     

  3. To solve this, you just need to create the key with name <Service name> and set the two values. The resultant reg file will look like:

 

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\<Service Name>]

"EventMessageFile"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,\

00,6d,00,20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,4d,00,69,00,63,00,72,00,\

6f,00,73,00,6f,00,66,00,74,00,20,00,42,00,75,00,73,00,69,00,6e,00,65,00,73,\

00,73,00,20,00,53,00,6f,00,6c,00,75,00,74,00,69,00,6f,00,6e,00,73,00,2d,00,\

4e,00,61,00,76,00,69,00,73,00,69,00,6f,00,6e,00,5c,00,41,00,70,00,70,00,6c,\

00,69,00,63,00,61,00,74,00,69,00,6f,00,6e,00,20,00,53,00,65,00,72,00,76,00,\

65,00,72,00,5c,00,6e,00,61,00,73,00,73,00,71,00,6c,00,2e,00,65,00,78,00,65,\

00,00,00

"TypesSupported"=dword:00000007

 

That'sall folks! You can use that to solve this problem with every application. But you just needs to know, which file is the correct translator.

 

Posted by kine | 2 comment(s)
Filed under: ,

Vista RTM Screenshots...

For anybody, who is interested in, there are my screenshots of Vista with NAV 4.00SP2 (Update 1). There is screenshot with taskman for you to see the memory consumption etc. If you have some request for specific screenshot, ask me and I will try to post the screenshot... :-)

 Look at: http://msmvps.com/photos/kine/category2868.aspx
 

Posted by kine | with no comments