我搜索和搜索了很多,找不到我的答案。我希望看到 ClearQuest 中的父记录在其所有子记录未关闭之前不应关闭。以下是我现在的代码。但未能达到目标。请帮帮我?
set sessionObj = GetSession
CRdbid = GetFieldValue("dbid").GetValue()
Set entity = sessionObj.GetEntity("CR", CRdbid)
a = entity.GetFieldValue("CR_ID").GetValue()
set querydef = sessionObj.BuildQuery("CR_Child")
querydef.buildfield ("dbid")
querydef.buildfield("ChildCR_ID")
querydef.buildfield("state")
set operator = querydef.BuildFilterOperator(AD_BOOL_OP_AND)
operator.BuildFilter "ChildCR_ID", AD_COMP_OP_LIKE, "a"
operator.BuildFilter "state", AD_COMP_OP_NEQ, "CLOSED"
set resultset = sessionObj.BuildResultSet(querydef)
resultset.execute
if resultset.MoveNext = AD_SUCCESS then
CR_Validation = "Close the child CR's"
End If