The following code works in my ALM 11.52 project. If it doesn't work in your project, tell us what version of the product you are working with and what error you are getting.
Sub Test_AfterPost dim TestConfigFact dim TCFFilter dim TestConfigList ' On Error Resume Next set TestConfigFact = TDConnection.TestConfigFactory set TCFFilter = TestConfigFact.Filter ' Set filter to retrieve Test Configs for the current test case TCFFilter.Filter("TSC_TEST_ID") = Test_Fields("TS_TEST_ID").Value ' Retrieve the data set TestConfigList = TCFFilter.NewList ' TestConfigList now points to a list of Test Configuration entities ' To get to a specific entity in the list use ' TestConfigList.Item(<index>) ' TestConfigList.Item(1) is a pointer to the first Test Configuration in the list. It is the same as a Test Configuration object from the OTA API. ' Check how many test configurations are in the list if TestConfigList.Count = 1 then ' Only one Test Configuration associated with the current Test
' Check if the custom field already has a value if len(TestConfigList.Item(1).Field("TSC_USER_01")) = 0 then ' The length of the string in the field is 0, therefore the field is empty
' Set the value in the custom field TestConfigList.Item(1).Field("TSC_USER_O1") = "my_string"
' Use TestConfigList.Item(1).Post to save the change to the Test Config TestConfigList.Item(1).Post end if end if Set TestConfigList = nothing Set TCFFilter = nothing Set TestConfigFact = nothing ' On Error GoTo 0 End Sub