Skip to main content

skip to main content

developerWorks  >  Rational  >

Populate a choicelist with full names of active users

developerWorks
Document options

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community


Rate this page

Help us improve this content


Level: Introductory

Rational staff, Staff, IBM

21 Apr 2004

This is an example of a user full name choicelist hook for customizing IBM Rational ClearQuest.

This item was originally published in May, 2002.

NOTE: This hook is presented only as an example of how to customize your use of IBM® Rational® ClearQuest®. It has not been formally tested, and is not supported by IBM.

Description

This hook shows how to populate a pick list with a list of active users' full names by creating a query to gather this information. Please do not use Admin session to gather this information.



Back to top


Script Language

VB Script



Back to top


Code

DIM RegularSession
  DIM queryDef
  DIM ResultSet
  DIM Is_Active_Value
  DIM colValue

  set RegularSession = GetSession
  set queryDef = RegularSession.BuildQuery("users")
  Is_Active_Value = 1

  queryDef.BuildField("fullname")

  set queryFilterNode = queryDef.BuildFilterOperator(AD_BOOL_OP_AND)
  queryFilterNode.BuildFilter "is_active", AD_COMP_OP_EQ, Is_Active_Value

  set ResultSet = RegularSession.BuildResultSet(queryDef)
  ResultSet.Execute
  status = ResultSet.MoveNext

  while status = AD_SUCCESS
    RegularSession.OutputDebugString ResultSet.GetNumberofColumns & vbCrLf
    For n = 1 to ResultSet.GetNumberofColumns
	  colValue = ResultSet.GetColumnValue (n)
	  choices.AddItem(colValue)
	  RegularSession.OutputDebugString colValue & vbCrLf
    Next
    status = ResultSet.MoveNext
  wend



About the author

This article is brought to you by the Rational staff at developerWorks.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top