Share this page

# Example: Copying Field Values to Another Object

This example shows how to use the TDConnection object to copy the value from the Build Number field of a Run (RN_USER_02) to the Last Ran On Build field of a Test in a Test Set (TC_USER_03).

Add the code to the `Run_AfterPost` event procedure.

    Sub Run_AfterPost
            On Error Resume Next
            Dim tdc
            set tdc = TDConnection
            Dim TSFact 'As TestSetFactory
            Set TSFact = tdc.TestSetFactory
            Dim TstSet 'As TestSet
            Set TstSet = TSFact.Item(Run_Fields("RN_CYCLE_ID").Value)
            MsgBox TstSet.Name
            Dim TSTestFact 'As TSTestFactory
            Set TSTestFact = TstSet.TSTestFactory
            Dim TSTst 'As TSTest
            Set TSTst = _
    	 TSTestFact.Item(Run_Fields("RN_TESTCYCL_ID").Value)
            MsgBox TSTst.Name

            TSTst.Field("tc_user_03").value = _
    	 Run_Fields("RN_USER_02").Value
            TSTst.Post

            PrintError ("Run_AfterPost")
            On Error GoTo 0
    End Sub

https://admhelp.microfocus.com ALM 8942
Tips to improve your search results... ALM Help Center ALM Help Center ALM Help 16.00-16.0.1 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: