• Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ

Olof Simren - Microsoft Dynamics 365 Business Central Blog

  • Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ

C/AL Editor in Dynamics NAV 2016

November 25, 2015 Posted by Olof Simren Development, General 16 Comments

The 2016 version of Microsoft Dynamics NAV comes with a new C/AL editor. This is a big step forward for people that are writing code within Microsoft Dynamics NAV.

The C/AL editor have, in my mind, always been much behind other code editors in terms of usability, but with the 2016 version Dynamics NAV catches up a bit. This blog post is about the new features you will find when you start writing code in Dynamics NAV 2016.

The first thing that you will notice when you open the C/AL editor is how the functions looks with their colors etc. and that there are line numbers to the far left.

CAL-Editor-Dynamics-NAV-2016

The functions can be expanded and collapsed manually by using the small +/- sign next to their names or through the Edit menu where you also can Collapse or Expand All at the same time. Kind of nice actually, no need go to the C/AL Globals anymore to see a list of the functions (just collapse them all and you see both the function names and their variables).

Collapse-Expand-in-CAL-Editor-Dynamics-NAV-2016

The line numbers will help with keeping track of where you are and navigating in the code. You can select entire lines by selecting the numbers on the left and when you are selecting lines in the code the editor does no longer select full rows when you select multiple rows. This means that you can do a selection that starts and ends in the middle of a row. Basic it seems like, but a nice addition (I always thought that the way the old editor worked when it came to selecting code was a bit annoying).

Selecting-Lines-in-CAL-Editor-Dynamics-NAV-2016

Then when you start wring your code the fun starts. You will see lines modified as highlighted in yellow.

Modified-Lines-in-Yellow-Dynamics-NAV-2016

Then when you compile your changes they show up as highlighted in green (even if the line does not compile actually 🙂 ).

Saved-Modifications-Lines-in-Green-Dynamics-NAV-2016

Unfortunately after closing and reopening the object the yellow/green highlight is gone. Would have been cool if they remained as an indication of a part of the object that was custom modified (maybe a blue color or something).

As long as you don’t close the object you can also undo (ctrl+z) and redo (ctrl+y) your changes. Nice! 🙂 This is another one that seem like a basic thing, but you have never been able to do this before, which has been frustrating if you for example happen to delete a line by mistake and you have not saved your changes for a while (which have happen to me many times). The undo also works after the changes have saved, so you can save a change then test it and if it does not work you can undo it again, pretty cool (as long as you don’t close the object that is, if you close the object you are done with undoing).

Undo-and-Redo-CAL-Editor-Dynamics-NAV-2016

Then when you start typing your code you see that it come with intellisense that provides easy access to variables, fields, functions etc., nice! This is probably the biggest change of them all.

The good old F5 (C/AL Symbol Menu) is still around but it does not seem like you can use it for inserting code anymore, it just opens and you can go up/down and left/right in it but when you hit OK or enter nothing is inserted. I am guessing that this is a way to make sure people using the intellisense instead when writing code. For me this will be a big change, I have used F5 for 13 years (that key is almost worn out 🙂 ) and suddenly it does not work the same way anymore. But I am sure once I get used to the intellisense it will be much better than the’old’ way.

Here are some examples of the intellisense feature;

Tables, functions, etc.. shows up the moment you start typing.

Intellisense-example-1-CAL-Editor-Dynamics-NAV-2016

After selecting a table the intellisense displays the list of fields for you to select from, the fields narrows down while typing. Key fields has a small key next to them.

Intellisense-example-2-CAL-Editor-Dynamics-NAV-2016

When you are entering an option value then the options shows up after you entered the ‘::’, this is very useful. Up until now I have always typed ‘::xx’ and then pressed F11 to compile to see the options through the error message, no need to do that anymore. 🙂

Intellisense-example-3-CAL-Editor-Dynamics-NAV-2016

The above are just some examples of the features in the intellisense. One thing that I think is lacking is if you enter a ‘table.VALIDATE(‘ then the list of fields does not show up, you have to enter the table again first (like below) and then go back and delete the table name if you want it to look like standard NAV code. Would have been nice if the fields showed up directly.

Intellisense-example-4-CAL-Editor-Dynamics-NAV-2016

Another great feature is that the table definition is shown if you hover over a table variable. The table definition shows the field names, types, and lengths as well as asterisks next to the primary key fields. This list of fields can also be resorted by clicking the headers.

Table-Definition-CAL-Editor-Dynamics-NAV-2016

In addition to the table definitions, you can also see the definitions of the functions and other types of variable if you hover over them. Hover over a function and you see the variables that the function should be called with and what its returning.

Function-Definition-With-Variables-CAL-Editor-Dynamics-NAV-2016

When you hit return to go to the next line it sometimes indents the next line and sometimes not, if it is after a ‘THEN’ it indents it for example. This is one thing to get used to I think. In the old editor it just went to the same indentation level as the line above, now you need to look at the screen a bit to know if you need to hit tab or not (or even backspace twice) when you enter a new line.

Indentation-On-New-Line-CAL-Editor-Dynamics-NAV-2016

The Find and Replace function has been enhanced to handle regular expressions, which offers a more advanced way of searching. Not that I have missed this feature before but it seems useful. Apparently regular expressions are use in other programing editors, so why not in Dynamics NAV.

Use-Regular-Expressions-In-Find-Replace-Editor-Dynamics-NAV-2016

Some more information about how to build the search strings can be found by just googling ‘regular expressions’. My experience with this is limited, feel free to post a comment below if you have a useful example for this.

There is also a new option to zoom in and out in the editor. This is useful to adjust for high or low resolution screens. I have an ultra wide monitor with the resolution of 3440×1440, so for me zooming in could be useful (especially when I get older 🙂 ).

Zoom-In-CAL-Editor-Dynamics-NAV-2016

This is what I have found being the new and useful stuff in the new C/AL editor in Dynamics NAV 2016. If you prefer to still use the old one when programming in Dynamics NAV 2016, then you can do this by just adding ‘useoldeditor=Yes’ to the shortcut for the finsql.exe like below.

Use-Old-CAL-Editor-Dynamics-NAV-2016

Not sure why you would do that, but there is this option.

Note that I will be at the Convergence 2015 EMEA in Barcelona next week talking and showing this new C/AL editor for Dynamics NAV 2016 along with other new features (like the recording of permissions) in the KCP Dynamics booth (booth number 3). If you are at the convergence, please visit booth number 3 and say hi (I believe we will be service Columbian coffee as well).

Share this:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X

Related


Discover more from Olof Simren - Microsoft Dynamics 365 Business Central Blog

Subscribe to get the latest posts sent to your email.

Tags: CALConvergence 2015 EMEAIntellisenseKCP DynamicsNAV 2016Regular Expression
16 Comments
Share
3

About Olof Simren

I am a Microsoft Dynamics NAV and 365 Business Central Expert, I started implementing Microsoft Dynamics NAV in 2002, back then it was called Navision Attain. Throughout the years there has been many exciting implementations in different parts of the world, all of them with different challenges but with one common theme; manufacturing. As a consultant, I bring over 20 years of experience in implementing Microsoft Dynamics NAV and 365 Business Central within manufacturing and distribution companies. The services I offer includes project management, consultation, development and training. Feel free to contact me if you need help with anything related to Microsoft Dynamics NAV or 365 Business Central. I work through my company Naviona where I team up with other skilled Microsoft Dynamics NAV and 365 Business Central Experts.

You also might be interested in

Autofill Variable Name in NAV 2015

Apr 16, 2015

By accident I discovered something quite interesting last week and[...]

XML Buffer and CSV Buffer Tables

Mar 27, 2017

Most of us that’s been programming in Dynamics NAV for[...]

Record Permissions in NAV 2016

Nov 9, 2015

One of the new super useful features in Microsoft Dynamics[...]

16 Comments

Leave your reply.
  • Luc van Vugt
    · Reply

    November 26, 2015 at 1:32 AM

    Hey Olof,

    Wow, what a detailed description of the new editor! I will surely refer to this for my customers, students, colleagues. Thanx!

    And .. have noticed this: https://nav-skills.com/2015/11/13/nav2016-code-editor-undocumented-features/

    Ciao,
    Luc

    • Olof Simren
      · Reply

      Author
      November 26, 2015 at 6:27 AM

      Thanks Luc!
      Nice with some additional ‘undocumented’ things. 🙂
      Although, the BEGIN/END matching does not seem to work for me (looks nice though).

      Cheers!

      /Olof

  • Akhilesh
    · Reply

    November 26, 2015 at 1:47 AM

    Good one Olof Simren … 🙂

  • Mark Brummel
    · Reply

    November 28, 2015 at 2:02 PM

    The Begin/End only works in CU1.

    The old symbol menu will be brought back in one of the next CUs.

    There is a nice other trick in the new editor, I will blog it asap.

    • Olof Simren
      · Reply

      Author
      November 28, 2015 at 2:49 PM

      Ok, tanks for the info, good to know.
      Curious about the ‘other’ trick. 🙂

      /Olof

  • Peik Bech-Andersen
    · Reply

    November 29, 2015 at 9:33 AM

    Hi Olof,

    Great presentation.
    I agree with Mark Brummel, the F5 Symbol menu functionality will return.

    You might want to add the Block functionality:

    Customer.”No.”:=NewNo;
    Customer.Name:=NewName;
    Customer.Address:=NewAddress;
    Customer.Address2:=NewAddress2;
    Customer.”Post Code”:=NewPostCode;
    Customer.City:=NewCity;

    Now position the cursor on the C on the first Customer. line
    Then press Shift+Alt and mark right to right before the period and down to include the last Customer line.
    This will mark a block covering the “Customer” on all the lines.
    Now you can delete all Customer. by pressing delete.

    Lastly with the same selection, type Vendor. Now the lines will look like this:

    Vendor.”No.”:=NewNo;
    Vendor.Name:=NewName;
    Vendor.Address:=NewAddress;
    Vendor.Address2:=NewAddress2;
    Vendor.”Post Code”:=NewPostCode;
    Vendor.City:=NewCity;

    Have fun with that 🙂

    • Olof Simren
      · Reply

      Author
      November 29, 2015 at 2:37 PM

      Thanks, did not know this. Quite nice!

      /Olof

  • VIJAY BAHETI
    · Reply

    December 2, 2015 at 7:27 AM

    thanks … good information for me.

  • Lars
    · Reply

    December 21, 2015 at 12:31 PM

    Nice write-up as always!

    Good to hear the symbol menu is coming back! Then I will switch over to the new editor.

    I hope MS will also brings back the possibility to mark all code in an object with ctrl+A and delete it. Very useful e.g. when creating a temp table for an upgrade codeunit.

    /Lars

  • David Bouillot
    · Reply

    December 30, 2015 at 3:02 PM

    Nice description of this new editor… I love it and now you can select text from middle of one line to middle of another one… One small point… It’s a bit slow with intellisense and sometimes you have to click OK 2 times to be considered.

  • Thomas
    · Reply

    January 28, 2016 at 2:36 AM

    Currently there are more short comings than good features in the new Editor.
    Programming with it is now around 50% slower than before.
    Beside the bespoken fact that the F5 symbol menu does not work, there are more issues with it:

    * Listing of Options is sorted by Alphabet rather than Option ID, why is that? How would you use that for filtering for Ranges if you do not know the exact order of the options defined?
    * Intellisense does not work at all when starting a field name with Double Quotation marks
    * Intellisense does not search with the *BLA* pattern as in Visual Studio, therefore you must again look into th Symbol menu when searching a field – and agein, you cannot directly select and lookup the content.
    * Intellisense does not pick up field names only when typing the opening bracket after a SETRANGE, SETFILTER, SETCURRENTKEY, etc.
    * You cannot mark all code and delete it (in a Table as we need to do when merging – it is still not possible to just “merge” the fields when importing tables. Either Way (New->Existing,Existing->New) will throw errors).

    There are some more issues I found but I’m quite tired by the new editor.
    It is a way faster to use the old one.

    • Olof Simren
      · Reply

      Author
      January 28, 2016 at 11:11 AM

      Hi Thomas,
      You can still use the old editor.
      You should forward your findings/concerns to Microsoft, I am sure the editor will be improved over time.

      /Olof

  • Lars
    · Reply

    February 9, 2016 at 3:09 AM

    I just upgraded to CU4 and now the Symbol Menu (F5) works as it should.

    • Olof Simren
      · Reply

      Author
      February 9, 2016 at 5:28 PM

      Good to know, many thanks for the info!

      /Olof

  • Subhash Gunwant
    · Reply

    February 9, 2017 at 7:05 AM

    Thanks for nice information about new CAL editor.

  • Thatthep
    · Reply

    September 14, 2018 at 12:32 AM

    I want c/al editor in dark theme like VS 2017

Leave a Reply

Your email is safe with us.
Cancel Reply

Subscribe to My Blog via Email

Check Out Our Apps in AppSource

My Dynamics NAV Partner

Naviona, LLC

Categories

  • Assembly (3)
  • Development (35)
  • Finance (14)
  • General (28)
  • Inventory (24)
  • Manufacturing (36)
  • Miscellaneous (27)
  • Purchase (9)
  • Sales (11)
  • Warehouse (7)

Tags

.net Add-in AI AppSource Assembly Assembly BOM Business Central CAL Capacity Consumption Contact Copilot Costs Customer Development Dimensions Excel Finance Flushing General Ledger Inventory Item Item Tracking Low-Level Code MRP NAV 2015 NAV 2016 Output Planning Production Production BOM Production Orders Purchase Orders Receipts Reporting Reports Routing Sales Sales Order Stockkeeping Unit Subcontracting Task List Warehouse Warehouse Shipment Work Center

Recent Posts

  • Business Central Configuration Audit using Vibe Coding
  • Copilot in Planning Parameter Worksheet
  • Copilot in Planning Worksheet
  • Copilot Inventory Queries
  • Record Deletion Tool for Business Central in AppSource
  • Reopen Finished Production Orders
  • XML Buffer and CSV Buffer Tables
  • Functionality Improvements in NAV 2017
  • Reversing Production Output and Consumption
  • Return Merchandise Authorization (RMA)

Categories

  • Assembly
  • Development
  • Finance
  • General
  • Inventory
  • Manufacturing
  • Miscellaneous
  • Purchase
  • Sales
  • Warehouse

Contact Us

We're currently offline. Send us an email and we'll get back to you, asap.

Send Message

Categories

  • Assembly (3)
  • Development (35)
  • Finance (14)
  • General (28)
  • Inventory (24)
  • Manufacturing (36)
  • Miscellaneous (27)
  • Purchase (9)
  • Sales (11)
  • Warehouse (7)

Tags

.net Add-in AI AppSource Assembly Assembly BOM Business Central CAL Capacity Consumption Contact Copilot Costs Customer Development Dimensions Excel Finance Flushing General Ledger Inventory Item Item Tracking Low-Level Code MRP NAV 2015 NAV 2016 Output Planning Production Production BOM Production Orders Purchase Orders Receipts Reporting Reports Routing Sales Sales Order Stockkeeping Unit Subcontracting Task List Warehouse Warehouse Shipment Work Center

Recent Posts

  • Business Central Configuration Audit using Vibe Coding
  • Copilot in Planning Parameter Worksheet
  • Copilot in Planning Worksheet
  • Copilot Inventory Queries
  • Record Deletion Tool for Business Central in AppSource
  • Reopen Finished Production Orders
  • XML Buffer and CSV Buffer Tables
  • Functionality Improvements in NAV 2017
  • Reversing Production Output and Consumption
  • Return Merchandise Authorization (RMA)

Recent Comments

  • Olof on Business Central Configuration Audit using Vibe Coding
  • Andrew Trayfoot on Business Central Configuration Audit using Vibe Coding
  • Barrett Allen on Reopen Finished Production Orders
  • Kateryna on Business Central Configuration Audit using Vibe Coding
  • Takeshi Setoya on Reopen Finished Production Orders
  • Steve on Consignment Inventory
  • Olof Simren on Copilot in Planning Worksheet
  • Omaer Amjad on Copilot in Planning Worksheet

© 2026 · Olof Simren

  • Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ
Prev Next