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…


  • 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.

5 thoughts on “NAV 5.0 Preview – Part 1 – The C/AL”

  1. I am not assuming such a big change in Automation interface. In Automation server virtual table I can see same automations as in older versions, it means nothing more is accessible than before. I didn’t tried to create my own library and use it, I am giving just 20% possibility of this change…

  2. As longs as Navision is written in unmanaged Code we’ll have do define COM-Interfaces with all the Interfaces, Registry-Entries, etc.

    I’m wondering if we’ll be able to hack some .net controls into the new 5.1 client by using the good old winapi – functions.

  3. The thing I don’t get is why they have not even mentioned most of those functions in the training materials available so far. At the moment they only say that they have added 4 functions:


    Microsoft at times is quite clearly barmy.

Leave a Reply

Your email address will not be published. Required fields are marked *