Reference manual

Objects page

Usages window

Find Usages lists every place an object, field, procedure, variable or other declaration is used. The results open in the Usages window, grouped by module, object and the declaration that holds each usage, with a search box and, for fields and table methods, a filter panel.

Opening it

The search runs in the background. When it finds nothing, a notification says No usages found and no window opens. Without a license, Find Usages runs only for parameters and variables.

Prism for AL Usages window with the usages of a field, the filter panel open and the context menu of a procedure
The usages of a field, with the field filter open and the context menu of a procedure.
#NameDescription
1QueryWhat was searched: select all direct usages of the target, and in the object searched when there is one. For built-in functions it reads select the functions applied to the table.
2Usage countN usages, or X of N usages while the search box or the filter panel hides some.
3UsageThe code line or declaration with the usage. Select it to go to the usage in the workspace window.
4Row context menuRight-click a row to pin it or to find the usages of the declaration that holds the usage. See Row context menu.
5Pinned rowA row you pinned, marked with a pin.
6SearchKeeps the rows that contain the text, as a substring search.
7Toggle filter panelShows or hides the filter panel (Ctrl+O). Enabled for the usages of a field and for built-in functions on a table. See Field filter and Temporary record filter.
8Collapse all nodesCollapses every row.
9Expand all modulesExpands the modules and collapses everything else, showing modules and objects.
10Expand all objectsExpands the objects and collapses everything else, showing modules, objects and their top-level declarations.
11Expand down to pinned nodesExpands the paths down to your pinned rows.
12Expand all nodesExpands every row.
13Copy results to ClipboardCopies the shown usages. See Copy the results.
14Show where assigned and readLists every usage of the field. See Field filter.
15Show where assigned onlyLists only where the field is given a value.
16SaveSaves the include options of the chosen filter as your default.
17Filter ratio barHow many of the usages are shown. Shown while the search or the filter hides some, unless Show filter ratio bar is off.

Results

The results form a tree: module, object, then the procedures, triggers and other declarations down to the code line with the usage. Select any row below a module to go to it; double-clicking does the same. While you scroll, the ancestors of the top row stay pinned at the top of the list; select a pinned row's chevron to collapse its group.

Whether the filter panel starts open and whether the groups start expanded are set under Find usages on the Settings page.

Row context menu

Right-click a row for:

Field filter

For the usages of a field, the filter panel chooses between all usages and assignments only. Each choice has its own include options, which are dimmed while the other choice is selected. The save button beside a choice keeps its current include options as your default for the next search; it is shown beside the selected choice.

OptionUnderIncludes
Include PropertiesAssigned and readUsages in properties.
Include Key DefinitionsAssigned and readKeys that contain the field.
Include TransferFieldsBothTransferFields calls on the field's table.
Include Clear(Record|Field)BothClear of the record or of the field.
Include Message|Confirm|Error parametersAssigned and readThe field passed to Message, Confirm or Error.

Hover over the help icon beside Show where assigned only for what counts as an assignment: :=, +=, -=, *=, /=, Validate, Evaluate, Clear, ModifyAll, and passing the field to a var parameter.

Temporary record filter

When you find the usages of built-in functions such as Insert or Delete on a table, the filter panel tells temporary records from persistent ones. Persistent means a record declaration that is not temporary.

Prism for AL Usages window with the temporary record filter
1 2 3
The usages of built-in functions on a table, with the temporary record filter.
#NameDescription
1Temporary record filterShown for the usages of built-in functions on a table.
2Show all usages (temporary and persistent)The default. Lists the calls on temporary records as well as those on records stored in the database.
3Zoom in on persistent usagesLeaves out usages on temporary records. Persistent global and local variables and persistent by-value parameters are always included. Under Usages of by-reference parameters, choose Include all (whether declared persistent or temporary) or Only include if declared persistent.

A by-reference (var) parameter declared temporary can still be passed a persistent record: AL enforces the declaration neither when it compiles nor when it runs. Keep Include all (whether declared persistent or temporary) to be sure no persistent usage is left out. Choose Only include if declared persistent when you trust that every call passes a temporary record to a temporary var parameter.

Find where a field is written

Use this when a field holds a value you did not expect and you need the code that sets it.

  1. Open the table in the object view and right-click the field.
  2. Select Find Usages. The Usages window opens.
  3. Press Ctrl+O to open the filter panel.
  4. Select Show where assigned only. Clear Include TransferFields and Include Clear(Record|Field) to see only direct assignments.
  5. Select each usage to read it in context.

The window lists the assignments only; the count at the top tells how many of all usages they are.

Copy the results

  1. Narrow the list with the search box and the filter panel until it shows what you want to share.
  2. Select Copy results to Clipboard.
  3. Paste into a spreadsheet or a message.

The copy holds the usages the window shows, as tab-separated text with a header row and one row per usage: the module's publisher and name, the object's type and name, the declarations that hold the usage, and the code.

An unhandled error has occurred. Reload 🗙