Absent Member.. bryanalton Absent Member..
Absent Member..
2064 views

ActionCanExecute does not display any action names

All of a sudden if I use msgbox ActionName in Action Can execute I never get anything popping up. The only time it seems to work is if I click on one of my custom buttons that I created. Any idea why this would not work suddenly? Here is the entire code of the ActionCanExecute Function

 

Function ActionCanExecute(ActionName)
  'Use ActiveModule and ActiveDialogName to get
  'the current context.
  msgbox ActionName 'Nothing ever happens like ActionCanExecute is not called
  'msgbox ActionName.Count
  'msgbox activemodule
  On Error Resume Next
If ActionName = "CopyTSPath" Then
   Call CopyTSPath
End If
If ActionName = "CopyTSTestsVals"  Then
   Call UpdateTSTestVals
End If
ActionCanExecute = DefaultRes
If ActionName = "LinktoTicket" Then
   Call LinkToTIcket
End If
LinktoTicket = DefaultRes
If ActionName = "actBugDetails" Or ActionName = "actNextDefect" Then
   'Call IntializeFieldView

   If Bug_Fields("BG_USER_01").Value = "QC Enhancement Request" Or "Automation Request" Then
      Bug_Fields("BG_STATUS").List = Lists("QC Enhancement Status")
   ElseIf Bug_Fields("BG_USER_01").Value = "Dev Process Enhancement" Then
      Bug_Fields("BG_STATUS").List = Lists("QC Enhancement Status")
   ElseIf left(Bug_Fields("BG_USER_01").Value) = "Prod" Then
      Bug_Fields("BG_STATUS").List = Lists("Bug Status")
   Else
      Bug_Fields("BG_STATUS").List = Lists("Issue Type")
   End If

End If
If Not Bug_Fields("BG_DETECTED_IN_RCYC").IsNull Then
  Cycle = right(Bug_Fields("BG_DETECTED_IN_RCYC").Value.Name, 3)
  If ucase(Cycle) = "DEV" Then
    Call SetStatusList(Cycle)
    'msgbox ActionCanExecute
      ActionCanExecute = True
    End If
End If

If ActionName = "AutoAssignTeams" Then
   Call AutoAssignTeams
End IF

On Error GoTo 0
End Function

0 Likes
7 Replies
Absent Member.. bryanalton Absent Member..
Absent Member..

Re: ActionCanExecute does not display any action names

I removed everything from ActionCanExecute except the below code:

Function ActionCanExecute(ActionName)
  'Use ActiveModule and ActiveDialogName to get
  'the current context.
  msgbox "In ActionCanExecute"
  msgbox ActionName
  'msgbox ActionName.Count
  'msgbox activemodule
  'On Error Resume Next
     ActionCanExecute = DefaultRes
End Function

 

None of the messageboxes ever fire. No matter what I do inside QC it never seems to call ActionCanExecute unless I actually click on one of my userdefined functions. Anyone have any idea why that might be? Any help would be greatly appreciated....


Thanks,

Bryan

0 Likes
Absent Member.. Trudy Claspill Absent Member..
Absent Member..

Re: ActionCanExecute does not display any action names

What is the version and patch level of your QC system?

Have there been any recent changes to your QC system, like a new patch install?

Does this happen with every workstation you use? What OS are the workstations where this happens?
[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
0 Likes
msmithson
New Member.

Re: ActionCanExecute does not display any action names

bryanalton,

 

One approach that I found helpful is to treat the user defined events in two ways.

 

First I deal with my user defined cases - note the prefix "UserDefinedActions." is required for toolbar icons we add

- this is in the first set of Select Case / End Select

 

Second I handle action events that happen in a module - the same action event is used / reused by the script so it's important to first check which mod your in.

- this is handled in the second Select Case / End Select

 

At any of these you can add the msbbox "ActionName: " & ActionName to see hwat's going on. Hope this is helpful

 

 

Function ActionCanExecute(ActionName)

 

   '- set error handler
   On Error Resume Next

 

   '- default return value
   ActionCanExecute = DefaultRes

 

   Select Case ActionName
        '- Handle events for user defined icons

            Case "UserDefinedActions.Add_Sample_Defects"
            <code to execute here>


   End Select


   '- Handle events based on current module
   Select Case ActiveModule

      Case "Test Plan"
         Select Case ActionName
            Case "RequirementCoverage.SelectReq"
                  <code to execute here>
                  '- don't execute default function
                  ActionCanExecute = False

         End Select

   End Select

Knowledge Partner Knowledge Partner
Knowledge Partner

Re: ActionCanExecute does not display any action names

Check for possible duplication of the function name in the workflow code. I have seen that happen.
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
brunofazoli Absent Member.
Absent Member.

Re: ActionCanExecute does not display any action names

Hi

 

Do you have any update on that? I'm facing the same issue on ALM 12. The pop-up is not triggered

 

Thank you

0 Likes
DeyanChavdarov Honored Contributor.
Honored Contributor.

Re: ActionCanExecute does not display any action names

last resort is to debug your WF script. You can start with "DebugView" which will display which WF events were started and then if you do not succeed just debug it witm MVS - http://h30499.www3.hp.com/t5/Quality-Center-Support-and-News/Need-Help-for-Workflow-code-DEBUG-by-using-Attach-to-Process/m-p/6344219#M83908

 

BR,

 

Deyan

[Give Kudos or accept as Solution, if post helped you :)]
0 Likes
Highlighted
Absent Member.. Marco Neureuthe Absent Member..
Absent Member..

Re: ActionCanExecute does not display any action names

msgbox not msbox

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.