Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Highlighted
Trusted Contributor.. Monica Trusted Contributor..
Trusted Contributor..
299 views

Look Up list for particular requirement type(User defined)

I have created 2 requirement types a) Implementation Header  b) Implementation Details

While creating a req type of (b) Implementation Details I want a field Parent_Header and it should contain a list of Requirements whose Requirement type is Implementation Header(a)

I want help in writing a code for look up list for Parent Header whose user field name is RQ_USER_TEMPLATE_14

I have written a code for the look up list and calling it in Sub Template_Req_FieldChange(FieldName) as call AddItemToList("Parent_Implementation Header","oReq")

 

Function AddItemToList(ListName,ItemName)
On Error GoTo 0

Dim oCustomization
Dim myList
Dim listRoot
Dim newListItem
Dim CLists
Set oCustomization = TDConnection.Customization
Set CLists = oCustomization.Lists
Set myList = CLists.List("Parent_Implementation Header")
Set listRoot = myList.RootNode
Dim oReqFactory
Dim oList
Dim aFilter
Dim oReq
Dim RType
Set oReqFactory = TDConnection.ReqFactory
Set aFilter = oReqFactory.Filter
aFilter.Filter("RQ_TYPE_ID") = 109
Set oList = aFilter.NewList
For Each oReq In oList
msgbox oReq.Name & " : " & oReq.TypeId & " : " & oReq.RequirementType.Name
Set newListItem = listRoot.AddChild(oReq)
oCustomization.Commit
Set AddItemToList = newListItem
Next
End Function

 

0 Likes
1 Reply
Trusted Contributor.. Monica Trusted Contributor..
Trusted Contributor..

Re: Look Up list for particular requirement type(User defined)

This code works but i want the structure to be similar to Target Release drop down ..Is it possible?

Function AddItemToList(ListName,ItemName)
On Error GoTo 0

Dim oCustomization
Dim myList
Dim listRoot
Dim newListItem
Dim CLists
Dim oReqFactory
Dim oList
Dim aFilter
Dim oReq
Dim RType
Set oReqFactory = TDConnection.ReqFactory
Set aFilter = oReqFactory.Filter
aFilter.Filter("RQ_TYPE_ID") = 109
Set oList = aFilter.NewList
For Each oReq In oList
Set oCustomization = TDConnection.Customization
Set CLists = oCustomization.Lists
Set myList = CLists.List("Parent_Implementation Header")
Set listRoot = myList.RootNode
Set newListItem = listRoot.AddChild(oReq.Name & " : " & oReq.TypeId)
Next
oCustomization.Post
Set AddItemToList = newListItem
End Function

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.