Reference manual

Code fragment window

A code fragment window holds a copy of some code lines and where they came from. Use it to keep a piece of code in view while you navigate elsewhere, to write notes about it, or to share it with a colleague. Its title names the declaration the code comes from.

Prism for C/AL code fragment window with copied code lines and a note
1 2 3 4 5 6
A code fragment window.
#NameDescription
1ObjectThe id and name of the object. Select it to go to the object.
2DeclarationThe group and name of the declaration. Select it to go to the declaration.
3Code linesThe copied lines.
4Line markerSelect it to go to the exact place of this line in the object.
5NotesYour notes about the code. See Share code with notes.
6Copy source to clipboardCopies the fragment, with your notes, to the clipboard. See What the copy holds.

Opening a code fragment window

On the Prism tab of the Object view:

  • Mark code lines (select a line, then another to mark the lines between them), right-click a marked line and choose Copy Code to New Window.
  • Or right-click the Code header of a trigger or procedure and choose Copy code to new window to copy the whole block.

Each command opens a new window, so you can keep several fragments open. See Selecting and copying code for the other ways to copy code.

Share code with notes

  1. Open the code in a code fragment window.
  2. Type your explanation in Notes.
  3. Select Copy source to clipboard.
  4. Paste into the email or ticket.

The reader gets the code, your notes and where to find the code.

What the copy holds

The copy holds, in this order:

  1. Source code fragment context: the store, the object and the declaration.
  2. Notes, when you wrote any.
  3. Source code fragment text: the code.

The window does not save the notes: they are gone when you close it.