- Getting Started
Questions & Answers — or How do I …?
- How do I find usages of objects, procedures, fields, variables and keys?
- How can I find out where Sales Invoices are deleted via code?
- I find it cumbersome to export objects all the time, can Prism help me?
- We're using version control for C/AL objects — can we access the objects directly from there?
- How can I find an object if I don't remember the exact name?
- I know part of a procedure name, how can I quickly find the procedure?
- How can I find publishers and subscribers?
- A user got an error message — how do I find the code causing this?
- How can I copy code from Prism?
- How can I share a search result with a colleague?
- How can I specify which files and directories are scanned when opening a Directory Store?
- Which versions of NAV are supported?
- Special Features
- User Interface Tips & Tricks
Download and Install
First you need to download and install Prism for C/AL. Head over to the Download page 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.
Browse Your C/AL Code
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.
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 — "Goto Declaration".
Continue now to use Prism or read the Questions and & Answers section for answers to typical questions.
Questions & Answers — or How do I …?
How do I find usages of objects, procedures, fields, variables and keys?
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.
From the result window, click a line to navigate to the "usage site".
How can I find out where Sales Invoices are deleted via code?
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:
From the result window, click a line to navigate to the "usage site".
You can use a similar search for other useful things, of course. The feature works for all supported object types, as long as you are searching for something in the form "object.SYSTEMFUNCTION".
I find it cumbersome to export objects all the time, can Prism help me?
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:
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:
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 trouble-shooting page.
We're using version control for C/AL objects — can we access the objects directly from there?
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" buton 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.
How can I find an object if I don't remember the exact name?
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:
You will find similar search fields in various places in Prism for C/AL.
I know part of a procedure name, how can I quickly find the procedure?
If you know the name contains "export" and "xml" in that order, use menu "Search | Procedures by Name…"and search for "export*xml":
You can find table fields in a similar way.
How can I find publishers and subscribers?
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:
A user got an error message — how do I find the code causing this?
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 Contant 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:
Now navigate to the Text Constants to figure out which of these usage is the correct one. Then use "Find Usages" on that Text Constants, and you have found the code causing this error message.
How can I copy code from Prism?
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:
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:
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:
How can I share a search result with a colleague?
How can I specify which files and directories are scanned when opening a Directory Store?
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:
For details on filter syntaxt, please see the label tooltips in Prism.
Which versions of NAV are supported?
Prism for C/AL supports NAV versions from NAV 5 SP1 to NAV 2018 as well as Business Central 14 (C/AL). Maybe earlier versions of NAV are supported, too, but we have not tested extensively.
Exploring Table Relations
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 289 Payment Method in the index, then right-clicked it and selected "Explore Table Relations" - and further explored relations a bit.
|1||The table id and name|
|2||The number of unexplored inbound table relations (relations from other tables into the table).|
|3||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.
Right-clicking on a table in the graph will show a context-menu with these options:
|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||(Not applicable for tables; see Table Relation Details below)|
|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.
Table Relation Details
Given a table relation (a line/curve between two boxes), it is possible to investigate where in the source code the table relation occurs. To do that, simply right-click on a line/curve and select the only option available: Show details. This action will perform a Find Usages search with the given table relation.
User Interface Tips & Tricks
Collapse & Expand Panels
To gain more space to view code on a small screen, you can collapse and expand the Index and Explorer side panels: