Find and Insert Snippets

You can find and insert snippets using the Snippet tab of the Resource Browser in the Write Script worksheet. For dynamic and static server pages, you can also use snippets in the Design Layout worksheet.

  1. Position the cursor at the location in the Code Editor where you want to insert the snippet.
  2. If it is not already active, select the library containing the snippet you want to use.

    In the Model tab U-Bar, click libsnp: and select the desired library.

  3. Start typing one or more keywords that represent the snippet content, as found in the Alternative Name or Description.

    Note: The alternative name and description can provide information about the purpose or content of the snippet, whereas the actual snippet name is far less useful.

    In the Snippets tab, spaces are treated as wild cards, so there is no need to use other wild cards (although they are supported). For example, to find snippets for field-level error triggers, you could enter err fld or fld err.

    For example, you can filter snippets intended for a target object (cpt, occ, or fld) or module type (trigger, webtrigger, or operation), as well finding a module name (accept, exec, quit and so on) or snippet description.

  4. To insert the snippet into your code, select it, right-click and choose Insert Snippet from the context menu.

    Alternatively, choose Copy text, and then paste it at the desired location in the code.

    If you select and copy multiple snippets, their content is pasted with a line feed separating the different snippets.