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.
| # | Name | Description |
|---|---|---|
| 1 | Search box | The text to search for. Press Enter to search. See Searching. |
| 2 | Wildcards | Point at the icon for a reminder of the wildcards. |
| 3 | Scope | This, Filtered or All. See Scope: This, Filtered, All. |
| 4 | Search / Cancel | Search starts the search; while it runs, the button turns into Cancel, which stops it and keeps the lines found so far. |
| 5 | Status line | How many lines matched in how many objects, and how long the search took. |
| 6 | Case sensitive | Matches upper and lower case exactly. Off by default. |
| 7 | Line limit | The most lines a search returns, marked ≤. See Searching. |
| 8 | Object type chips | One per object type in the results, with its number of lines. See Object type chips. |
| 9 | Results | The matching lines, grouped by module, object and member. See Results. |
| 10 | Preview | The selected line in its code. See Preview. |
| 11 | Settings | Opens 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*documentfindsPostDocumentandPostSalesDocument.- 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:
| Status | Meaning |
|---|---|
| Searching… | The search is running. |
| N lines in M objects · T s | The search finished in T seconds. |
| N lines in M objects · T s · stopped at the L-line limit | The search stopped at the line limit; there may be more lines. |
| N lines in M objects · T s · canceled | You canceled the search; the lines found so far are shown. |
| Search canceled | You canceled the search before it found a line. |
| No code lines match | Nothing in the scope matches. |
Scope: This, Filtered, All
| Scope | Searches | Key |
|---|---|---|
| This | The object open in the workspace. | Ctrl+3 |
| Filtered | The objects the Objects panel shows with its current search and filter. | Ctrl+2 |
| All | Every 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
| # | Name | Description |
|---|---|---|
| 1 | Collapse all nodes | Collapses the tree to its modules. |
| 2 | Expand modules | Expands the modules and collapses everything else, so you see modules and objects. |
| 3 | Expand objects | Expands modules and objects and collapses everything else, so you see their top-level declarations. |
| 4 | Expand down to pinned nodes | Expands the paths to the pinned nodes. Shown while a node is pinned. |
| 5 | Expand all nodes | Expands the whole tree. |
| 6 | Copy results to Clipboard | Copies the visible results as indented text, one line per row. Rows of a type you have hidden with a chip are left out. |
| 7 | Rows kept at the top | While 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. |
| 8 | Pinned line | A 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
#ifleaves 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
| # | Name | Description |
|---|---|---|
| 1 | Title | The object and the member the line is in. |
| 2 | Selected line | The match, highlighted, with its line number. |
| 3 | Other result | Another 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
| Key | Action |
|---|---|
| Enter in the search box | Starts the search. |
| Enter in the results | Goes to the selected object, member or line. |
| Ctrl+1 | Scope All. |
| Ctrl+2 | Scope Filtered. |
| Ctrl+3 | Scope This. |
Find a code pattern in some objects
Use this to find, for example, every Commit in the codeunits of one app.
- In the Objects panel, narrow the objects to the ones you want, for example the codeunits of one module.
- Press Ctrl+Shift+F and select the Filtered scope.
- Type
Commit(and press Enter. - 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.