How to execute, enable, disable, and hide a button using the VBScript Workflow

The Actions command can be used to execute, enable, disable, and hide a button. The following example demonstrates how to disable and hide the R&D Comments button as well as the corresponding R&D Comment view upon entering the Defect module.

Usage:

Execute

Actions.Action("BugAddDevCommentsAction1").Execute

Enable

Actions.Action("BugAddDevCommentsAction1").Enabled = true

Note:

If there is a corresponding menu option, you should check it also:

Actions.Action("_dxact_main_menu_menu_rdcomments").Checked = true

Disable

Actions.Action("BugAddDevCommentsAction1").Enabled = false

Note:

If there is a corresponding menu option, you should uncheck it also:

Actions.Action("_dxact_main_menu_menu_rdcomments").Checked = false

Hide

Actions.Action("BugAddDevCommentsAction1").Visible = false

Example:

Sub Defects_EnterModule

On Error Resume Next

Actions.Action("BugAddDevCommentsAction1").Enabled = false

Actions.Action("BugAddDevCommentsAction1").Visible = false

Actions.Action("_dxact_main_menu_menu_rdcomments").Visible = false

On Error GoTo 0

End Sub

1 thought on “How to execute, enable, disable, and hide a button using the VBScript Workflow”

  1. Hi, the “Add Comment” button is not showing up in defect module. I am new to QC. where can i find the code ? how to make it visible.

    Thanks
    Prem

    Reply

Leave a Comment