Share this page

# Action Object

You can use the Action object to verify whether a button or command is enabled, checked, or visible. You can also use it to execute actions.

For example, to set the Defect Details dialog box to open automatically when the user moves from one defect to another in the Defects Grid, place the following code in the `Bug_MoveTo` event procedure:

    Set NewDefectAction=Actions.Action("Defects.DefectDetails")
    NewDefectAction.Execute

To obtain the name of an action, add the following lines to the ActionCanExecute event procedure, perform the action, and note the action name that is printed in the message:

    Sub ActionCanExecute(ActionName)
            On Error Resume Next
            MsgBox "You have performed an action named: " & ActionName
            On Error GoTo 0
    End Sub

This object has the following properties:

Property | R/W | Type | Description
--- | --- | --- | ---
Checked | R/W | Boolean | Indicates whether an action is checked in ALM.
Enabled | R/W | Boolean | Indicates whether an action is enabled. A disabled action cannot be invoked by the user, but can be invoked from the workflow script.
Visible | R/W | Boolean | Indicates whether an action is visible in ALM.

The Action object includes the following method:

Method | Description
--- | ---
Execute | Executes the action.

When a workflow script invokes an action using the Execute method of the Action object, the workflow events that would be triggered if a user initiated the action from a dialog box are by default not triggered. Therefore, when using Action.Execute, you must ensure that you do not bypass the site policies you are enforcing with workflow events.

To enable workflow events to be triggered from within a dialog box, set the value of the AllowReentrancy flag to true. To restore the default settings, so that these events are not triggered, set the value of the AllowReentrancy flag to false. For example, to set the Add Defect dialog box to open automatically when a user enters the Defects module, place the following code in the EnterModule event procedure:

    AllowReentrancy=true
    Set NewDefectAction=Actions.Action("Defects.DefectDetails")
    NewDefectAction.Execute
    AllowReentrancy=false

If the value of the AllowReentrancy flag is set to false, the dialog box opens as usual, but workflow customizations will not work in the dialog because the workflow events for the dialog box are not triggered.

Caution: Consider carefully the implications of setting the value of this flag to true. If you set the value of the flag to true, you enable a function to call another function which may call the original function. This can cause an endless loop. This can also occur when functions call internal functions which call the original function.

https://admhelp.microfocus.com ALM 8942
Tips to improve your search results... ALM Help Center ALM Help Center ALM Help 15.5-15.5.1 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: