GetMatchingRepeatingFormsCount( )

获取与作为搜索关键字提供的项值匹配的表单的重复表单实例数。

  • 可以接受选项控制(单选控件、复选框控件和下拉列表),但只能按标签搜索,不能按值搜索。
  • 只能提供一个选项作为选项控制的搜索文本。
  • 日期必须使用以下格式作为字符串提供:'Date(dd-mmm-yyyy hh:mm:ss)'
  • 您可以采用以下格式使用部分日期:
    • <dd-mmm-yyyy hh:mm>
    • <dd-mmm-yyyy hh>
    • <dd-mmm-yyyy>
    • <mmm-yyyy>
    • <yyyy>
  • 必须使用以下格式以字符串形式提供时间:'Time(hh:mm:ss)'
  • 可以采用以下格式使用部分时间:
    • <hh:mm>
    • <hh>

语法

GetMatchingRepeatingFormsCount('variable1', value1, 'variable2', value2, ...)

参数

注:

允许在规则表达式的其他位置重用传递到此函数的变量,但是您必须使用单引号将变量添加为参数。
参数 必填/可选 说明
variable 必需 要进行求值的规则变量,使用单引号传入。
value 必需 要搜索的值。

返回值

表示与给定变量的传递值匹配的重复表单实例计数的数字。

注:

在日期中,UNK 值被视为与任何其他值匹配。例如:'Date(01-Feb-2022)''Date(20-Feb-2022)' 都视为 UNK-Feb-2022 日期值的条目匹配项。

示例

示例 3-58 如果存在多个 AE 结果 = 'Fatal' 的实例,则引发查询

// Raise a query if there is more than one instance where AE Outcome = 'Fatal"
 
// Get current repeating instance
var ins = GetCurrentRFInstance();
var curVal = "";
 
// Get value of aeOut from current instance
var rfData = getRFValues('ins', [aeOut] );
if(rfData.exists && rfData.aeOut){
        if((rfData.aeOut) !== "[]"){    // If the choice control has been cleared out then do not read the label
            curVal = JSON.parse(rfData.aeOut)[0].label;
    }
}
 
// check to see if there are more than 1 instance with "Yes"
return ((curVal == "Fatal") && (GetMatchingRepeatingFormsCount('aeOut', "Fatal") > 1))?false:true;