Creating and inserting shared actions

About this task

Shared actions are stored in databases and can be found under the Shared Code heading in the Design pane. Once you create a shared action, any other view, folder, form, subform, or page in the database can access the shared action.

To create a shared action

About this task

Procedure

  1. In an open database, double-click Actions under Code in the Applications Navigator. A list of shared actions appears with information about each shared action.

    This information lets you know whether the shared action appears in an action bar or in a menu, whether a graphic is associated with the action, what the code type is (formula, simple action, LotusScript®, JavaScript, or Common JavaScript), and whether the action appears in Notes®, on the Web, or for mobile users.

    Note that if the database is set up to be a multilingual database, shared actions can be grouped under multiple sections called shared action notes. These shared action notes act like folders for different languages.

  2. To create a new shared action, click the New Shared Action button. Alternatively you can choose Create - Design - Shared Action. (If you have shared action notes, make sure you first select the shared action note under which you want the shared action to appear.)

    The Actions Properties box appears.

  3. On the Action Info tab:
    • Enter a name for the shared action.
    • Label name -If you want dynamic labeling of actions, enter a formula in the label field. The dynamic label then appears as the name in the button or checkbox and on the action menu. Note that dynamic labeling works only in Domino® Designer 6 or later. Earlier versions of Domino® Designer use the name as the label.
    • If applicable, specify a target frame (in the current frameset) to be the target of the action. For example, if you create an action that opens a view, specify the name of the frame in which the view should open.
    • Select the display type for the action. You can choose Button, Checkbox, or Menu separator.
    • Check "Include action in Action bar" to make the action available as an item in the action bar.
    • If the action is a button action, you can also choose to have only the icon appear in the action control bar.
    • Check "Right align action control" to have the action control aligned on the opposite side of whatever is set in the Action Bar Properties box. Note that it may not necessarily be right aligned.
    • Check "Include action in Action menu" to make the action available as a menu item in the Actions menu.
    • Check "Include in right mouse button menu" to make the action available as a right mouse click menu item for views. The action will be listed in a new section at the end of the right mouse click menu. When the action is hidden on the Action menu, it will be hidden on the right mouse click menu. If the action is a shared action, it will be visible on the right mouse click menu of all views using that shared action.
    • Check "Display as a split button" to display two buttons for the action when it is used in a composite application. The left button will display the icon and button label, and execute the first subaction if clicked. The right button will display a drop-down arrow, and will activate the drop-down menu of all subactions if clicked.
      Note: The "Display as a split button" option is only available for the Personal Information Management (PIM) composite application designs Mail, Calendar and Contacts.
    • You can select an icon to appear on the action button. If you prefer a Notes® graphic, select Notes® and then click Image to select a graphic for the icon from a set available in Notes®.
  4. Click the Hide When tab to specify when to hide the action.
  5. Click the Advanced tab and specify how Notes® workflow proceeds after the user activates the action.
  6. In the Info List of the Programmer's pane, click Objects and select the shared action you just created.
  7. To program the shared action to run one of the client or one of the Web program code types, choose either Client or Web at the Run pull-down list.

    Choose Client when the automated task will run in the Notes® client. You can then select one of the following Client code options:

    Choose Web when the automated task will run in a Web browser. You can then select one of the following Web code options:

  8. Save the shared action.

To create shared action notes

About this task

A shared action note is found only in multilingual databases and acts as a folder for shared actions of one language. Each shared action note in a database contains the same actions. The difference between the shared action notes is the language and the region to which they are set.

To create shared action notes in a multilingual database:

Procedure

  1. At the Design tab of Application Properties, check "Multilingual database" so that the database is set as a multilingual database.
  2. In an open database, double-click Shared Actions under Code in the Applications Navigator.
  3. Click New Shared Action Note.

  4. Select the shared action note and choose Design - Design Properties. The Design Document Properties box appears.
  5. At the Design tab, select the language and the corresponding region, if any, for all the actions contained in this shared action note (for example, Portuguese as the language and Brazil as the region).
  6. For each new shared action note, set the language and region and make sure the note contains the same shared actions as are found in the other shared action notes in this database.
  7. Right click each shared action to check its Action ID. The Shared Actions Properties box appears. At the Action Info tab for each shared action:
    • Make sure each shared action in a shared action note has a different Action ID.
    • Make sure the Action ID for a shared action is the same across shared action notes. For example, if a Cancel action contained in the Danish shared action note is set to Action ID 16, the Cancel action contained in the Turkish shared action note should also be set to Action ID 16.

To delete a shared action note

Procedure

  1. Select the shared action note.
  2. Choose Edit - Delete.

Results

Note: When you delete a shared action note, you delete all the shared actions it contains.

To insert a shared action

Procedure

  1. Open the view, folder, form, subform, or page where you want to use the shared action.
  2. Choose Create - Action - Insert Shared Action. The Insert Shared Action dialog box appears.
  3. Select a shared action and click Insert for each shared action you want to insert. Each shared action is added to the Action pane and also to the Objects list for the design element.
  4. Click Done when you are finished inserting shared actions.
  5. In the Info List, you can click Objects and select an action, or select an action in the Action pane.

Results

The next time you use the view, folder, form, subform, or page, the shared action is available.

To edit shared actions

Procedure

To edit a shared action, open the database with the shared action. Click Shared Code, then Actions, and then double-click the shared action you want to edit. The Shared Action Properties box appears.