Learn more about Statical Prism


Learn more about Statical Prism

Statical Prism minimizes the time you spend understanding the code on a Microsoft Dynamics NAV solution. It can do a super browse of the C/AL code, and click through the dependencies. Easy to find usages (used by or using) on global or local variables, on procedures, fields, keys, objects and system functions.
Watch video about Statical Prism

Getting Started with Statical Prism

1. Download and Install

First you need to download and install Statical Prism. Head over to the subscribe section to download your copy of Statical Prism. You will then either get a trial license or a commercial license. The installer is straightforward. Once you have installed, just continue from here.

2. Load Objects

When Statical Prism starts up, it shows the control panel window. The control panel gives several options for getting objects into Statical Prism. To begin with, we recommend that you simply export all NAV objects of your favorite 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.
The Statical Prism control panel

3. Browse Your C/AL Code

When Prism finishes loading the store, you can start browsing 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.
An open store
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 indicates that you can navigate to the declaration by left-clicking the name — “Go to Declaration”. Continue now to use Prism or read the Questions & 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.
Result of Find Usages
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:
Result of Find Usages
From the result window, click a line to navigate to the “usage site”.
Result of Find System Function Usages
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, Statical Prism allows you to set up mirrors that connect directly to Dynamics NAV 2013+ databases. Statical Prism will then track and export object changes for you. First you need to set up a mirror. From the control panel, open the mirror manager using the mirror icon or through the menu:
The Statical Prism mirror setup window
In the Mirrors screen, hit the “+” button or choose menu “File | New Mirror…”. Give the mirror a name, select an NAV Adapter (there is only one available at the moment), and fill in Database Server and Database Name fields. If you want to connect to the database with Windows authentication, then leave the fields Database User Name and Database User Password empty. Finally, select “Full Path To FinSql.exe”. Press the “Test this mirror” button to validate the information you have entered. Press the “Save” button to save the mirror. Statical Prism will now and then (by default every 10 minutes) try to 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. Go for a coffee, as this can take a couple of minutes, as all objects will be exported. When the synchronization has finished, open the mirror store from the Mirrors screen, or from the control panel using the “Open Mirror Store…” button. While you have a mirror store open, Statical Prism continues to synchronize in the background. However, the changes are not applied until you reload the store. When updates are available, a little icon gets enabled, and allows you to reload the mirror:
The Statical Prism mirror setup window
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 and we plan to open-source the adaptor component so that the community can 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?

Statical Prism 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. Statical Prism 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 Statical Prism’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.

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:
Searching objects
You will find similar search fields in various places in Statical Prism.

I know part of a procedure name, how can I quickly find it?

If you know the name contains “export” and “xml” in that order, use menu “Search | Procedures by Name…”and search for “export*xml”:
Find Procedure by Name
You can find table fields in a similar way.

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 Statical Prism’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 Statical Prism and hit the Search button:
Search Text Constants
Now navigate to the Text Constants to figure out which of these usages 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 share a search result with a colleague?

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

Which versions of NAV are supported?

Statical Prism supports NAV versions from NAV 5 SP1 to NAV 2018 and Business Central. Maybe earlier versions of NAV are supported, too, but we have not tested.

From the  original statical prism webpage