The client-side Tray Options API enables you to create and manage custom options in the tray menu of a module. These options can either be actions performed on the module, or different views of the module.
Represent an action option and a module view option respectively. The objects have the following properties:
Property |
Description |
---|---|
text |
The text of the option |
position |
The position of the option in the tray menu (1-100) |
moduleID |
The module ID |
callback ( ActionOption only) |
The callback function that implements the action |
URL ( ViewOption only) |
The URL of the module view, which can be any of the following:
|
launchMode ( ViewOption only) |
Defines how to launch the view. Possible string values are as follows:
|
roleAvailability |
Defines the workspace user role(s) for which this option is available: workspace members, or managers, or both managers and members. Possible values are defined by the following constants in the TrayOptions object:
|
Serves as a factory for creating and adding options to the module tray menu. To use the methods of the TrayOptions object, obtain a reference to the object as follows:
var trayOptionsManager = EPCM.getSAPTop().TrayOptions;
createAction(text, position, moduleID, callback, roleAvailability)Creates an ActionOption object.
Parameters
See the above table.
createView (text, position, moduleID, URL, launchMode, roleAvailability)Creates a ViewOption object.
Parameters
See the above table.
addOptions (options)Adds the specified options to the module tray.
Parameters
options: An array of options, both actions and views
Note that tray options created with the help of this API appear only in the module view in which they were added. The options are lost when the user navigates to a different module view.