setQueryMessage( )
在规则内动态设置查询消息。此查询消息用于在规则返回 false 时创建查询。
注意:
此函数不能用于生成通知的规则。
在将日期传递到此函数之前,可以使用 getDateDMYFormat( ) 帮助函数设置日期格式。
语法
setQueryMessage(strMessage)返回值
包含已设置用于创建查询的查询消息的字符串。或者,如果函数运行过程中出现任何错误,则为空字符串。
注意:
如果动态查询消息的值为空、未定义、空字符串或仅包含空格,则不设置该消息。运行规则时未设置动态查询消息时,将使用规则创建时提供的默认查询消息。
示例 3-100 在权重小于 120 时设置查询消息
// Given "weight" item containing value of 110.
if (weight < 120){
var strMessage = "Subject weight of " + weight + " lb is less than the required weight of 120 lb."
setQueryMessage(strMessage);
return false; // create query
} else {
return true; // close query
}
// A query is created with message "Subject weight of 110 lb is less than the required weight of 120 lb."父主题:格式设置和其他函数