Set sessionObj = GetSession()
prj_name = GetFieldValue(\"item\").GetValue()
Set queryObj = sessionObj.BuildQuery(\"one_menu\")
queryObj.BuildField (\"model_one_menu\")
Set filterObj = queryObj.BuildFilterOperator(AD_BOOL_OP_AND)
filterObj.BuildFilter \"pm\", AD_COMP_OP_EQ, prj_name
Set resultSetObj = sessionObj.BuildResultSet(queryObj)
resultSetObj.Execute
Do While resultSetObj.MoveNext = AD_SUCCESS
choices.AddItem resultSetObj.GetColumnValue(1)
SessionObj.OutputDebugString resultSetObj.GetColumnValue(1)
Loop
3、新建一个field,其field name为:“二级菜单”,type为:REFERENCE,其Reference To为:“二级菜单”。其choice list为BASIC,点Basic的右键,点Hook properties;在出现的对话框中选中:Recalculate choice List.其代码如下:
Dim sessionObj
Dim queryObj
Dim filterObj
Dim resultSetObj
Dim prj_name Set sessionObj = GetSession()
prj_name = GetFieldValue(\"one_menu\").GetValue()
Set queryObj = sessionObj.BuildQuery(\"two_menu\")
queryObj.BuildField (\"model_two_menu\") [Page]
Set filterObj = queryObj.BuildFilterOperator(AD_BOOL_OP_AND)
filterObj.BuildFilter \"one_menu\", AD_COMP_OP_EQ, prj_name
Set resultSetObj = sessionObj.BuildResultSet(queryObj)
resultSetObj.Execute
Do While resultSetObj.MoveNext = AD_SUCCESS
choices.AddItem resultSetObj.GetColumnValue(1)
SessionObj.OutputDebugString resultSetObj.GetColumnValue(1)
Loop
文章来源于领测软件测试网 https://www.ltesting.net/