Getting started

First you need to download and install Prism for C/AL. Head over to the Download to download your copy of Prism for C/AL. The installer is straight-forward. Once you run Prism for C/AL for the first time, Prism for C/AL installs a 14-day trial license, so you are ready to continue.

When Prism for C/AL starts up, it shows the control panel window.

The control panel gives several options for getting objects into Prism for C/AL. To begin with, we recommend that you simply export all NAV objects of your favourite NAV code-base in text format. (You can read about other options further down.)

Now simply open the text export file by choosing "Open File Store…" in the control panel and locate the export file.

Prism for C/AL Control panel

When Prism finishes loading the store, you can start browing your C/AL code. First, select an object in the left-hand index of objects. The middle part then displays the object in a tree-like structure, and on the right, you see an outline of what's in the object, which objects the current object is Used By, and which objects the object Uses.

Prism for C/AL: browse code

Take a few minutes to familiarize yourself with the user interface and navigation.

Whenever something is declared, such as object, procedures, variables and parameters, notice that the cursor changes to a "context menu style", when the cursor is hovering over the name. This indicates that here a context menu is available via the mouse's right-click. For a declaration, the most prominent context menu is "Find Usages".

Now click on a procedure name in some object. Notice that the cursor changes to a hand when the cursor is hovering over the name of a procedure in a procedure call. This indications that you can navigate to the declaration by left-clicking the name ("Go to Declaration").

Continue now to use Prism or read the Questions and & Answers section for answers to typical questions.

Questions & Answers or How do I…?

Activate the context menu and select "Find Usages". This context menu is available in the left-hand side Index, in the right-hand side Explorer and in declarations in the (middle) object view.

Prism for C/AL: Find usages result

From the result window, click a line to navigate to the "usage site". Initiate other "Find usages" directly from the grouping headers. For table fields, use "Field filter options" to narrow result down to e.g. where the field is updated.

In the Index, right-click the Sales Invoice table and select "Find System Function Usages…". The select System Functions DELETE and DELETEALL and hit the "Search" button:

Prism for C/AL: Find system function usages

From the result window, click a line to navigate to the "usage site".

Prism for C/AL: Find system function usages result

You can use a similar search for other useful things, of course. The feature works for all object types, as long as you are searching for something in the form object.SYSTEMFUNCTION.

Yes, Prism for C/AL allows you to set up mirrors that connect directly to Dynamics NAV 2013+ databases. Prism for C/AL will then track and export object changes for you.

First you need to set up a mirror as follows:

Prism for C/AL: Create new mirror

After a couple of minutes, Prism for C/AL will have exported all objects in txt format (using finsql.exe command line). Unlicensed objects are ignored when supported by the finsql.exe version.

You can now open the mirror store from the control panel by using the "Open Mirror Store…" button.

Prism will periodically (by default every 10 minutes) synchronize new/changed/deleted objects from the mirrored database. The first synchronization exports all objects. Subsequent synchronizations will only export the new and changed objects. To force synchronization, press the "Synchronize all mirrors now" button.

While you have a mirror store open, Prism for C/AL continues to synchronize in the background. However, the changes are not applied until you reload the store. When updates are availble, a little icon gets enabled, and allows you to reload the mirror:

Prism for C/AL: Indication that the mirror updates are available

The Mirror integration method for the Dynamics NAV database is via an adapter component, which is currently only developed for Dynamics NAV 2013 (and later) versions. But there is no reason why adaptors for earlier version could not be developed. We have open-sourced the adapter component in the hope that someone in the NAV community will help develop further integration options.

If you experience problems with mirrors then please check out the Troubleshooting Mirrors section.

Prism for C/AL can open any directory containing C/AL objects in individual, as long as the files are in text format. When you use version control, you must have a workspace somewhere with the objects in text format.

Prism for C/AL supports a number of directory structure formats:

  • Unstructured Directory: No restrictions on file names and folder structures (other than file name extension must be .txt)
  • Prism Directory: This is Prism for C/AL's "native" directory layout
  • ReVision Directory: This is the directory layout used by iFacto ReVision

Typically, you will just use the Unstructured Directory format. To open such store, simply click the "Open Directory Store" button in the control panel and select the root folder holding your NAV objects in text format.

Notice that when you update your workspace from version control, then you need to reload the store. You can do that by closing the store, and then use Ctrl-1 in the control panel. That opens the most recently opened store.

You can use the little search field in the Index. Hover the mouse over the field and read the tool-tip for an explanation of the syntax. Here is an example:

Prism for C/AL: Searching objects with familar search syntax

You will find similar search fields in various places in Prism for C/AL.

If you know the name contains "export" and "xml" in that order, use menu "Search | Procedures by Name…"and search for "export*xml":

Prism for C/AL: Find procedure by name

You can find table fields in a similar way.

To find publishers and subscribers of business and integration events, use menu "Search | Procedures by Name…". If you do not want to restrict on name, then type "*" in the search field:

Prism for C/AL: Find publishers and subscribers by name

Let's assume the error message was "You cannot create this type of document when Vendor 12345 is blocked with type Payment".

It's a fair assumption that the error message is defined as a Text Constant in NAV, so you can use Prism for C/AL's "Search Text Constants by Content…". The trick is now to guess which part of the error message is text "variable", i.e. generated from place-holders in the Text Constant. In this case a good guess is that we should be searching for Text Constants matching this pattern: "you cannot*this type of document when *is*". Enter this search string in Prism for C/AL and hit the Search button:

Prism for C/AL: Search text constants

Now navigate to the Text Constants to figure out which of these usage is the correct one. Then use "Find Usages" on the Text Constants, and you have found the code causing this error message.

You can copy code lines directly from the Prism view, either the whole code section, a single line or multiple lines. The result can be either opened in a new window, copied to the clipboard (with or without context information), or opened in your default editor.

Here is how copy to new window works:

Prism for C/AL: Copy code to new window

Copying a single line without context is useful for locating the same line of code in C/SIDE. Here is how this works in a mirror store:

Prism for C/AL: Copy line, find in C/SIDE

You can also copy a whole block of code (procedure or trigger body). If you copy to a new window, you can add comments, then use copy to clipboard before pasting into e.g. an email:

Prism for C/AL: Copy code block

In the search result window, select the "Copy Usages to ClipBoard" button in the lower left corner. Then paste this into an Excel for handy table formatting.

When using Directory Store to load objects you may want to apply filters that control which files and directories Prism scans while loading the store. This is especially useful when the directory you open is a version control local folder, as there may be directories and files that do not contain source code.

For example, if you use git for version control and all your files have file name extension .txt or .cal, a setup could be like this:

Prism for C/AL: Directory store filters

For details on filter syntax, please see the label tooltips in Prism.

Prism for C/AL supports NAV versions from NAV 5 SP1 to NAV 2018 as well as Business Central 14 (C/AL). Customers have reported that earlier versions of NAV are supported, too, but we have not tested extensively.

Special Features

Sometimes a picture is worth a thousand words. Prism for C/AL can visualize table relations in a flexible and interactive way.

Let's start with an example. In the graphic below we have found table 46 Item Register in the index, then right-clicked it and selected "Explore Table Relations" - and further explored relations a bit.

Prism for C/AL: Table relations visualization
# Name Description
1 Table id and name The table id and name
2 Unexplored inbound The number of unexplored inbound table relations (relations from other tables into the table).
3 Unexplored outbound The number of unexplored outbound table relations (relations from the table into other tables)

The basic idea is simple: the selected table is opened and shown with all ingoing and outgoing table relations. The selected table is then "fully explored" in the 1st degree connections. However the related tables may themselves have further unexplored table relations.

Table and relations context menu:

Menu item Description
Explore all inbound (+n) Add the remaining n unexplored inbound table relations to the graph.
Explore selected inbound (+n) Open a list of the remaining n unexplored inbound table relations and choose which ones to add to the graph.
Explore all outbound (+n) Add the remaining n unexplored outbound table relations to the graph.
Explore selected outbound (+n) Open a list of the remaining n unexplored outbound table relations and choose which ones to add to the graph.
Explore all in/outbound (+n) Add the remaining n unexplored inbound and outbound table relations to the graph.
Exclude n selected Exclude n selected tables (and their relations) from the graph. Don't worry, these can be included again by selecting them in the Excluded Objects panel on the right, right-clicking and selecting the Include n Selected menu item.
Show details Only applicable for edges of the graph. Right-click on a line/curve and select Show details. This action will find table relations between the source and target tables.
Navigate to object Open the object in Prism (in the background window).

Note that it is possible to select multiple tables and explore them all simultaneously, in which case the above menu items will show the accumulated number of table relations to explore.

Also note that some tables have a huge number of inbound and/or outbound table relations, such as table 18 Customer. In that case it can be beneficial to hide certain tables and their relations. To do that simply left-click and drag the mouse to select the tables to exclude, then right-click on one of the selected tables to exclude the entire selected from the graph.

User Interface Tips & Tricks

To gain more space to view code on a small screen, you can collapse and expand the Index and Explorer side panels:

Prism for C/AL: Collapse and expand index and Explorer panels

Troubleshooting Mirrors

During mirror initialization your may get one of the following messages:

  • This database is registered with several NAV Server instances. You must choose an instance to use before performing this activity. Do you want to continue?
  • A service tier could not be contacted by the development environment (finsql.exe). Please open finsql.exe directly (without the id parameter), and select a service tier under menu 'File | Database | Information'. Then close the development environment again and synchronize the mirror again
  • There are no NAV Server instances available for this database
  • This database is registered with several NAV Server instances. You must choose an instance to use before performing this activity. Do you want to continue?>

The issue is that mirror synchronization uses the finsql.exe command-line, which (for some reason unknown to us) needs to connect to a service tier in order to export objects as txt files. This requires that the database "knows" which service tier to connect to. C/SIDE stores this information in the default zup-file.

Here is how you let C/SIDE know which (unique) service tier to connect to:

  1. Close all classic clients that you have open for the database
  2. Open classic client; this must be the exact finsql.exe that you have specified in the mirror configuration
  3. Open menu: File | Database | Information
  4. In the field "Server Instance", choose a service tier
  5. Close classic client
  6. In Prism, open the mirror manager and press the "Synchronize all mirrors now" button
  7. When synchronization has finished, you should be able to open the mirror. If not, please let us know via the built-in feedback facility (Help | Feedback...)

Mirror synchronization uses the finsql.exe command-line to export objects as txt files. The export command uses the NAV license uploaded to the database, so if license does not permit to export an object as txt, then you will get a message like this:

  • You do not have permission to read the <object name>' <object type>. Contact your system administrator to have your permissions changed.

If you get a message like this during mirror synchronizationand and you haveuploaded the correct NAV license to the databae, then do the following:

  • If the NAV version is 2015, then change the mirror adapter to Nav2015Adapte; the Nav2015Adapter automatically deals with unlicensed objects via the undocumented finsql.exe command-line option named ExportTxtSkipUnlicensed
  • If the NAV version is 2013, then change the "Object ID Include Filter" of the mirror to only include objects that are definitely licensed for export. When the initialization has finished successfully, you can relax the filter to include more objects. (On subsequent synchronizations, synchronization will not fail if an object is unlicensed. Instead, the mirror will remember that the object is unlicensed and not try to export from NAV again)