Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Re: re-point a customisation field to a new list

$
0
0

Quick code check ... so far I have this which is basically a copy / paste of a worked example from the knowlegebase

 

 

Option Explicit
Dim objQCConnection As TDConnection
Dim objReqFactory As ReqFactory
Dim cust As Customization
Dim custFields As CustomizationFields
Dim aCustField As CustomizationField
Dim custLists As CustomizationLists
Dim aCustList As CustomizationList
Dim listName$, cnt%
Dim msg As String

 

Sub main()
Connect

'Get the customization object and CustomizationFields
    'objQCConnection is the global objQCConnectiononnection object.
    Set cust = objQCConnection.Customization
    Set custFields = cust.Fields

'Walk through the fields of the bug table and output
' the some properties of the fields that are linked
' to custom lists.
    For Each aCustField In custFields.Fields("REQ")
        If aCustField.ColumnName = "RQ_USER_14" Then
 
            listName = ""
 
        'If the field is linked to a custom list, get the name
        ' of the list and the field properties.
            If Not (aCustField.List Is Nothing) Then
                cnt = cnt + 1
'-----------------------------------------
' Get the CustomizationList from
' CustomizationField.List
                Set aCustList = aCustField.List
                MsgBox aCustList.Name
                MsgBox ("Attempting Change...")
                aCustField.List.rootnode.ID = 8670
      
           End If
        End If
    Next
disconnect
End Sub

 

Sub Connect()
    Set objQCConnection = CreateObject("TDApiOle80.TDConnection")
    objQCConnection.InitConnectionEx "http://lnxpdb06:9080/qcbin/"
    objQCConnection.Login "someuser", "somepassword"
    objQCConnection.Connect "somedomain, "someproject"
End Sub

Sub disconnect()
   objQCConnection.disconnect
   objQCConnection.ReleaseConnection
End Sub

 

The question is should I be changing the list NAME or the ID. I cannot seem to set aCustList.Name

 

_Ed.

 

 


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>