Add(Name: String): IUiCommandAction;
Name. Name of the action, which parameters are to be added to the collection.
Select one of the following reserved names as the parameter value:
Parameter | Brief description |
Open | Opens an object. |
Save | Saves an object. |
SaveAs | Saves all changes to a new repository object. |
OpenFile | Opens an object from the file. |
SaveFile | Saves an object to the file. |
Export | Exports an object to supported formats. |
Prints an object. | |
PrintPreview | Object preview before printing. |
EditData | Edits object data. |
SaveData | Saves changed data. |
EditOriginal | Opens a dimension or a source dictionary for edit. |
CtrlDimNoEdit | The Editing command group in the context menu of dimension. |
If required, it is possible to specify prefix of the objects, to which the settings are applied for the common actions:
Report - regular reports (for example, Report.SaveAs).
Express - express reports (for example, Express.Export).
AdHoc - dashboards (for example, AdHoc.Open).
Parameter | Brief description |
Report.Modules | Regular report modules. |
Report.Map | Inserts a new map into regular report. |
Report.Mapselection | Changes the current regular report map. |
Express.Datasources | Changes a list of express report data sources. |
Express.Map | Shows express report map. |
Express.Mapselection | Changes the current express report map. |
Report.EditOriginal | Opens a data source or source dimension dictionary of regular report for edit. |
Express.EditOriginal | Opens a data source or a source dimension dictionary of express report for edit. |
AdHoc.EditOriginal | Opens a data source or a source dimension dictionary for edit. |
The Add method adds a new action to the collection and returns parameters of the added action.
Action names are case-insensitive. If the added action already exists in the collection, an exception is thrown.
Sub UserProc;
Var
WinApp: IWinApplication;
Command: IUiCommandActionCustomize;
Action: IUiCommandAction;
Begin
WinApp := WinApplication.Instance;
Command := WinApp.CommandActionCustomize;
Action := Command.Add("Save");
Action.Enabled := False;
Action.Visible := True;
Action := Command.Add("Export");
Action.Enabled := False;
Action.Visible := True;
Action := Command.Add("REPORT.MAP");
Action.Visible := False;
Action := Command.Add("EXPRESS.DATASOURCES");
Action.Visible := False;
Action := Command.Add("EXPRESS.EDITORIGINAL");
Action.Visible := False;
End Sub UserProc;
On executing the example the action parameters are determined for repository objects:
Save an object - the menu item is visible but not available.
Export an object - the menu item is visible but not available.
Insert a new map into regular report - the menu item is missing.
Change a list of express report data sources - the menu item is missing.
Opens a data source or source dictionaries in express report - the menu item is missing.
Visibility of menu items is applied both for the context menu and for the toolbar.
See also: