ClearQuest: Dependent Choice List doesn't refresh values when parent field value is changed
Hello,
I'm using CQ designer to create a new form. There’re 3 fields called Family, Product, Version Number in the interface below. The value of lower one field is dependent on value of upper one. For example, only when I set a value of Family, I can choose a product from the drop down list. If Family has no value, Product has no value. Similar to Version Number which is dependent on Product value.
The problem is that when I create a new record of this form, and set a Family value, and then go to “Product” drop down list, no options displayed. But if I click OK to save the record, and then re-open it, and select Product again, I can see the values. That means, in the first time in edit mode, "Product" field doesn't recalculate when "Family" is assigned a new value. But "Product" field is recalculated after saving and reopening the record.....
The same issue on Version_Number.
In "Value Changed" hook for Family field, I have a single line code to reset Product value when Family value is changed:
SetFieldValue "Product", ""
Sub product_ChoiceList(fieldname, choices)
' fieldname As String
' choices As Object
' record type name is ValidationObjective
' field name is Product
' Product name is dependent on Family value
Dim sessionObj
Dim filterObj
Dim queryObj
Dim resultSetObj
Dim family
Set sessionObj = GetSession()
family = GetFieldValue("Family").GetValue()
Set queryObj = sessionObj.BuildQuery("Family")
Set filterObj = queryObj.BuildFilterOperator(AD_BOOL_OP_OR)
filterObj.BuildFilter "Name", AD_COMP_OP_EQ, family
queryObj.BuildField ("products")
Set resultSetObj = sessionObj.BuildResultSet(queryObj)
resultSetObj.Execute
Do While resultSetObj.MoveNext = AD_SUCCESS
choices.AddItem resultSetObj.GetColumnValue(1)
Loop
End Sub
---------------------------------------------------------------------------------------------------------------
Can you advise me what to change? Thanks very much in advance.