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

Advertisements

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

  1. Prem

    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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s