Reference manual

Objects page

Free text search window

The Free text search window searches the AL source line by line, in the current object, in the objects the Objects panel shows, or in every object of the workspace. It lists the matching lines grouped by module, object and member, shows the selected line in its surrounding code, and goes to a line when you open it. Use it to find code that names cannot find: a text, a pattern of calls, a comment.

Opening it

  • Select Search › Free Text Search (Current Object)…, or press Ctrl+F, in the Workspace window to search the current object. With no current object, the window opens on all objects.
  • Select Search › Free Text Search (All Objects)…, or press Ctrl+Shift+F, to search all objects.
  • In Universal Search, select Search code for "…", or press Ctrl+Shift+F: the window opens on all objects with your text and starts the search.

Each time opens a new window, so you can keep several searches open side by side.

A search over all objects, with a line selected.
#NameDescription
1Search boxThe text to search for. Press Enter to search. See Searching.
2WildcardsPoint at the icon for a reminder of the wildcards.
3ScopeThis, Filtered or All. See Scope: This, Filtered, All.
4Search / CancelSearch starts the search; while it runs, the button turns into Cancel, which stops it and keeps the lines found so far.
5Status lineHow many lines matched in how many objects, and how long the search took.
6Case sensitiveMatches upper and lower case exactly. Off by default.
7Line limitThe most lines a search returns, marked ≤. See Searching.
8Object type chipsOne per object type in the results, with its number of lines. See Object type chips.
9ResultsThe matching lines, grouped by module, object and member. See Results.
10PreviewThe selected line in its code. See Preview.
11SettingsOpens the Settings page in this window.

Searching

  • Type the text in the box, which reads Search code lines (* and ? are wildcards) while empty, and press Enter or select Search. The text matches anywhere in a line, as if it started and ended with *; see Substring search with wildcards.
  • * matches any run of characters and ? any single character: post*document finds PostDocument and PostSalesDocument.
  • Spaces at the start and end of the text are ignored.
  • The search ignores case unless Case sensitive is on.
  • The line limit sets the most lines a search returns: 1, 10, 100, 1,000, 2,000 (the default), 5,000 or 10,000. When a search reaches it, the limit is dimmed and the status line says stopped at the N-line limit; raise the limit and search again to see more.
  • While a search runs, a progress bar shows under the results, and the box, the scope and the limit are disabled.

The status line reads:

StatusMeaning
Searching…The search is running.
N lines in M objects · T sThe search finished in T seconds.
N lines in M objects · T s · stopped at the L-line limitThe search stopped at the line limit; there may be more lines.
N lines in M objects · T s · canceledYou canceled the search; the lines found so far are shown.
Search canceledYou canceled the search before it found a line.
No code lines matchNothing in the scope matches.

Scope: This, Filtered, All

ScopeSearchesKey
ThisThe object open in the workspace.Ctrl+3
FilteredThe objects the Objects panel shows with its current search and filter.Ctrl+2
AllEvery object in the workspace.Ctrl+1

The scope applies to the next search. This and Filtered follow the workspace window as it is when you search.

Results

The results toolbar and tree.
#NameDescription
1Collapse all nodesCollapses the tree to its modules.
2Expand modulesExpands the modules and collapses everything else, so you see modules and objects.
3Expand objectsExpands modules and objects and collapses everything else, so you see their top-level declarations.
4Expand down to pinned nodesExpands the paths to the pinned nodes. Shown while a node is pinned.
5Expand all nodesExpands the whole tree.
6Copy results to ClipboardCopies the visible results as indented text, one line per row. Rows of a type you have hidden with a chip are left out.
7Rows kept at the topWhile you scroll, the module, object and member above the top row stay at the top. Select one to go to it, or its chevron to collapse it.
8Pinned lineA line you have pinned. See Context menus and pins.
  • The tree groups the lines under their module, object and member. Lines read in the code font and colors; code that an #if leaves out shows as a comment.
  • Selecting a row only shows it in the preview. Press Enter or double-click an object, member or line to go to it in the workspace window. Double-clicking a module expands or collapses it.

Object type chips

Above the results, a chip per object type in the results shows the type and its number of matching lines; point at it for the count in words, such as Codeunit: 12 lines. Every chip starts selected. Select a chip to hide or show the objects of that type. The chips filter the results you have; they do not search again.

Preview

The preview of a selected line.
#NameDescription
1TitleThe object and the member the line is in.
2Selected lineThe match, highlighted, with its line number.
3Other resultAnother matching line of the same object, marked with a bar beside its line number. Point at it to see Also a result.
  • The preview opens beside the results when you select a line, and shows the lines around it in color. Drag the divider between them to resize it.
  • Selecting a module, object or member shows its first matching line, so the preview stays in place while you move through the tree with the arrow keys.
  • A new search clears the preview.

Context menus and pins

Right-click a row for its context menu. Every row has Pin; the other items depend on the row.

Keyboard shortcuts

KeyAction
Enter in the search boxStarts the search.
Enter in the resultsGoes to the selected object, member or line.
Ctrl+1Scope All.
Ctrl+2Scope Filtered.
Ctrl+3Scope This.

Find a code pattern in some objects

Use this to find, for example, every Commit in the codeunits of one app.

  1. In the Objects panel, narrow the objects to the ones you want, for example the codeunits of one module.
  2. Press Ctrl+Shift+F and select the Filtered scope.
  3. Type Commit( and press Enter.
  4. Select a line to read it in the preview, and press Enter to go to it.

The results list only lines in the objects the Objects panel showed when you searched.