3.1. Create Scripts for Before Context Menu/Before Editor Context Menu Events

About this task

This topic describes how to create scripts Before Context Menu event and Before Editor Context Menu Event.

Before Context Menu Event

Procedure

  1. Click the Popup button to the right of the Before context menu event field.
  2. Select New Script on the Popup menu.

    An Edit Script window opens with the following default code.

    Sub OnPreContextMenu(oContextMenu As GefContextMenu)
                         End Sub

  3. Write and compile the script that is needed for the Before Context Menu event.
  4. Close the Edit Script window.

    The Save global script browser opens.

  5. Do the following.
    Item Field Action
    A File name Enter a name for the script.
    B File of type Select a script type. Options are: *.cms or *.bcl
  6. Click Open.
    The script can be applied to the Before context menu event.
  7. Click the Arrow button to the right of the Before context menu event.
  8. Select one of the following.
    Option Result
    <No action> The Before context menu event will not be used.
    Script Entry point Is triggered when a user opens a Popup (Context) menu on any CimView screen.

Before Editor Context Menu Event

Procedure

  1. Click the Popup button to the right of the Before editor context menu event field.
  2. Select New Script on the Popup menu.

    An Edit Script window opens with the following default code.

    Sub OnEditorPreContextMenu(oContextMenu As GefContextMenu)
    End Sub
  3. Write and compile the script that is needed for the Before Editor Context Menu event.
  4. Close the Edit Script window.

    The Save global script browser opens.

  5. Do the following.
    Field Action
    A File name Enter a name for the script.
    B File of type Select a script type. Options are: *.cms or *.bcl
  6. Click Open.

    Result: The script can be applied to the Before context menu event.

  7. Click the Arrow button to the right of the Before context menu event.
  8. Select one of the following.
    Option Result
    A <No action> The Before context menu event will not be used.
    B Script Entry point Is triggered when a user opens a Popup (Context) menu on any CimView screen.