CommandActionCustomize: IUiCommandActionCustomize;
The CommandActionCustomize property returns settings for the actions available for a repository object on opening this object to edit or preview.
The property returns settings collection for the actions available to a repository object. By default, the collection is empty, and action parameters are determined by system settings of the platform for each object type. Action parameters determined in this property have higher priority than the parameters determined in the IWinApplication.CommandActionCustomize property, but they are applicable only to the object, for which the item is selected.
In the current implementation, setting up of action parameters is available for the following repository objects:
Express reports.
Regular reports
Dashboards.
Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier.
Sub UserProc;
Var
MB: IMetabase;
MDesc: IMetabaseObjectDescriptor;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
CommandCust: IUiCommandActionCustomize;
Action: IUiCommandAction;
Begin
MB := MetabaseClass.Active;
//Object description
MDesc := MB.ItemById("EXPRESS_REPORT");
Target := WinApplication.Instance.GetObjectTarget(MDesc);
//Advanced settings used to execute commands
Context := Target.CreateExecutionContext;
//Actions parameters
CommandCust := Context.CommandActionCustomize;
Action := CommandCust.Add("Open");
Action.Enabled := False;
Action.Visible := True;
Action := CommandCust.Add("OpenFile");
Action.Enabled := False;
Action.Visible := True;
Action := CommandCust.Add("Save");
Action.Enabled := False;
Action.Visible := True;
Action := CommandCust.Add("Express.Mapselection");
Action.Visible := False;
//Opens object with specified parameters
Target.Execute("Object.Open", Context);
End Sub UserProc;
After executing the example the specified express report opens for view. Parameters for the number of actions available in the express report are determined before opening. Commands that are used to save and open express report are shown but unavailable. The option that enables the user to change the current map is also to be unavailable.
See also: