Topic
  • 7 replies
  • Latest Post - ‏2013-07-29T00:25:11Z by DonaldN
lee17
lee17
4 Posts

Pinned topic Dynamic List Hook (see attachment, could not post question to the field for some reason)

‏2013-07-22T15:10:00Z |

Attachments

  • DonaldN
    DonaldN
    287 Posts

    Re: Dynamic List Hook (see attachment, could not post question to the field for some reason)

    ‏2013-07-23T00:47:56Z  

    So the questions is:

    "I'm trying to create a VB hook in CQ for a choicelist. 

    I have a dynamic list called "os", with a list of operating systems.  Then I have lists osversion1, osversion1, osversion3 that I want to populate with the osversion field based on the selection chosen for os. I'm not a very strong scripter so I appreciate any assistance with this.  "

    And the answer is:

    http://www-01.ibm.com/support/docview.wss?uid=swg21133918

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/topic/com.ibm.rational.clearquest.apiref.doc/r_examples_crtdepchoicelst.htm

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/topic/com.ibm.rational.clearquest.apiref.doc/r_entity_setfldchclst.htm

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m1/topic/com.ibm.rational.clearquest.apiref.doc/t_examples_fielddeplist.htm

    The concept is more or less the same. The sample code only deals with only tier of the hierarchy, and you basically need to work your way down the hierarchy since you have three tiers to work with.

  • lee17
    lee17
    4 Posts

    Re: Dynamic List Hook (see question clarification attachment, browser does not let me write to field)

    ‏2013-07-23T14:52:19Z  
    • DonaldN
    • ‏2013-07-23T00:47:56Z

    So the questions is:

    "I'm trying to create a VB hook in CQ for a choicelist. 

    I have a dynamic list called "os", with a list of operating systems.  Then I have lists osversion1, osversion1, osversion3 that I want to populate with the osversion field based on the selection chosen for os. I'm not a very strong scripter so I appreciate any assistance with this.  "

    And the answer is:

    http://www-01.ibm.com/support/docview.wss?uid=swg21133918

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/topic/com.ibm.rational.clearquest.apiref.doc/r_examples_crtdepchoicelst.htm

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/topic/com.ibm.rational.clearquest.apiref.doc/r_entity_setfldchclst.htm

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m1/topic/com.ibm.rational.clearquest.apiref.doc/t_examples_fielddeplist.htm

    The concept is more or less the same. The sample code only deals with only tier of the hierarchy, and you basically need to work your way down the hierarchy since you have three tiers to work with.

  • DonaldN
    DonaldN
    287 Posts

    Re: Dynamic List Hook (see question clarification attachment, browser does not let me write to field)

    ‏2013-07-24T00:01:17Z  
    • lee17
    • ‏2013-07-23T14:52:19Z

    Again, I apologize, my browser will not let me post to the field.
    Thank you for your response and posting the question for me.  I can do a basic choicelist hook. I was unclear as to what I'm trying to accomplish.  
    The lists osversion1, osversion2, and osversion3 are also dynamic lists.  Dependent upon what os is selected, I want the osversion field to be populated with the appropriate choicelist. For example, if I choose "Windows" from os, I want the osversion field to populate the choices from osversion1 dynamic list.  And if I choose "Unix" I want the osversion field to populate with the choices from the osversion2 dynamic list.

    You only need to do one extra thing on top of the given sample code - read the dynamic list of your choice.

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/topic/com.ibm.rational.clearquest.apiref.doc/r_session_getlistmmbrs.htm

    For example, instead of doing

    ......

        case "Windows 2000"
          choices.AddItem ("Professional")
          choices.AddItem ("Professional SP1")
          choices.AddItem ("Server")
          choices.AddItem ("Server SP1")

    ......

    you will have this

    ......

      case "Windows"

        List = sessionObj.GetListMembers("osversion1")
        For Each listName In List
          choices.AddItem(listName)
        Next

    ......

  • lee17
    lee17
    4 Posts

    Re: Dynamic List Hook (see question clarification attachment, browser does not let me write to field)

    ‏2013-07-24T12:43:46Z  
    • DonaldN
    • ‏2013-07-24T00:01:17Z

    Again, I apologize, my browser will not let me post to the field.
    Thank you for your response and posting the question for me.  I can do a basic choicelist hook. I was unclear as to what I'm trying to accomplish.  
    The lists osversion1, osversion2, and osversion3 are also dynamic lists.  Dependent upon what os is selected, I want the osversion field to be populated with the appropriate choicelist. For example, if I choose "Windows" from os, I want the osversion field to populate the choices from osversion1 dynamic list.  And if I choose "Unix" I want the osversion field to populate with the choices from the osversion2 dynamic list.

    You only need to do one extra thing on top of the given sample code - read the dynamic list of your choice.

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/topic/com.ibm.rational.clearquest.apiref.doc/r_session_getlistmmbrs.htm

    For example, instead of doing

    ......

        case "Windows 2000"
          choices.AddItem ("Professional")
          choices.AddItem ("Professional SP1")
          choices.AddItem ("Server")
          choices.AddItem ("Server SP1")

    ......

    you will have this

    ......

      case "Windows"

        List = sessionObj.GetListMembers("osversion1")
        For Each listName In List
          choices.AddItem(listName)
        Next

    ......

    Thank you.  I was able to get this work work for only dynamic list "osversion1".  However, when I try to add in the other dynamic lists "osversion2" for Unix and "osversion3" for Linux, the field is now blank.

     

     

     

  • DonaldN
    DonaldN
    287 Posts

    Re: Dynamic List Hook (see question clarification attachment, browser does not let me write to field)

    ‏2013-07-25T00:16:41Z  
    • lee17
    • ‏2013-07-24T12:43:46Z

    Thank you.  I was able to get this work work for only dynamic list "osversion1".  However, when I try to add in the other dynamic lists "osversion2" for Unix and "osversion3" for Linux, the field is now blank.

     

     

     

    Sorry I'm not a mind reader. If you don't show your code here, I have no way to guess what you have done and what might have gone wrong.

  • lee17
    lee17
    4 Posts

    Re: Dynamic List Hook (see question clarification attachment, browser does not let me write to field)

    ‏2013-07-25T14:27:53Z  
    • DonaldN
    • ‏2013-07-25T00:16:41Z

    Sorry I'm not a mind reader. If you don't show your code here, I have no way to guess what you have done and what might have gone wrong.

    Attachments

  • DonaldN
    DonaldN
    287 Posts

    Re: Dynamic List Hook (see question clarification attachment, browser does not let me write to field)

    ‏2013-07-29T00:25:11Z  
    • lee17
    • ‏2013-07-25T14:27:53Z

    Dim os

    os = GetFieldValue("os").GetValue()
    set session = GetSession
    select case os
    case "Windows"
       List = sessionObj.GetListMembers("osversion1")
        For Each listName In List
          choices.AddItem(listName)
        Next
    case "Unix"
       List1 = sessionObj.GetListMembers("osversion2")
       For Each listname In List1
          choices.AddItem(listName)
          Next
    case "Linux"
         List2 = sessionObj.GetListMembers("osversion3")
       For Each listName In List2
           choices.AddItem(listname)
          Next
    End Select

    VBScript should be case-insensitive so your code should work. Can you make the "listName" or "listname" in the same case? Other than that, I don't see any problems with the code. You may want to do some debugging to find it out.

    http://pic.dhe.ibm.com/infocenter/cqhelp/v7r1m2/topic/com.ibm.rational.clearquest.apiref.doc/topics/c_debugging.htm