Users' Profiles



User's Requirement


When a User click a button in the Requirements module QC shows the list of Profiles of the connected user.




Proposed Solution


Creation of a custom button on the Requirements toolbar with a "little man" icon that when clicked call a function that returns the Profiles List through a msgbox window.



Implementation on the Product


Please refer to explanation on how to create a custom button that you can find in "Toolbar Button Editor" under WorkFlow Script Editor.



Suppose that the name of the Action join to the custom button is 

actUserGroupList, we'll do these operations:

  • insert code into the ActionCanExecute to call Sub and Function under Requirements Module
  • Creation of the Sub under Requirements Module call Req_UserGroupList that will be the main Sub that shows the List of Profiles
  • Creation of a Function that returns, in a string variable, the Profiles' List.



1. Call the Sub under Requirements Module

Function ActionCanExecute(ActionName)

On Error Resume Next

Dim Res

Res = True


if ActionName = "actUserGroupList" then


end if


ActionCanExecute = Res

On Error Goto 0

End Function



2. Main Sub under Requirements Module

Sub Req_UserGroupList

On Error Resume Next

Dim XmsgX, strElenco, arrElenco

XmsgX = "Users' Profiles" & vbNewLine & vbNewLine


strElenco = Req_ElencoProfili

'strElenco is the string variable consists on:



'Create of an array splitting the variable on pipe ("||") chars if exist.

if instr(strElenco, "||") > 0 then

   arrElenco = split(strElenco, "||")

   for i = 0 to Ubound(arrElenco) - 1

       XmsgX = XmsgX & arrElenco(i) & vbNewLine



   XmsgX = XmsgX & strElenco & vbNewLine

end if



msgbox XmsgX, vbSystemModal + vbInformation, "Quality Center"


On Error Goto 0

End Sub



3. Function that returns the List of Profiles

Function Req_ElencoProfili

On Error Resume Next

Dim Res, thisUsr, theGrList

Res = ""

set thisUsr = TDConnection.Customization.Users.User(User.UserName)

set theGrList = thisUsr.GroupsList


for i=1 to thGrList.Count

    Res = Res & i & ". " & thGrList.Item(i).Name & "||"



'Remove the last 2 pipes

Res = left(Res, len(Res)-2)


'Returns of the Result to the Function

Req_ElencoProfili = Res


On Error Goto 0

End Function




The result will be something similar to this window:





Pag: >    >>