过滤期限

要理解过滤器表达式,我们应该从 Filter Term 开始。这是一个简单的字符串数组,包含至少 3 个元素:

  1. 过滤 (字段/加入字段/公式/摘要)
  2. 运算符 (search.Operator)
  3. (字符串值(或字符串值数组),用作过滤器参数)
 // Simple example:
 ['amount', 'equalto', '0.00']
 
 // When the field is checkbox, use 'T' or 'F'
 ['mainline', 'is', 'T']

 // You can use join fields
 ['customer.companyname', 'contains', 'ltd']

 // summary filter term
 ['sum(amount)', 'notlessthan', '170.50']

 // summary of joined fields
 ['sum(transaction.amount)', 'greatherthan', '1000.00']

 // formula:
 ["formulatext: NVL({fullname},'John')", "contains", "ohn"]

 // and even summary formula refering joined fields:
 ['sum(formulanumeric: {transaction.netamount} + {transaction.taxtotal})', 'greaterthanorequalto','100.00']

 // for selection fields, you may use 'anyof'
 // and put values in array
 ['type','anyof',['CustInvc','VendBill','VendCred']]

 // when using unary operator, like isempty/isnotempty
 // don't forget that the filter term array contains at least 3 elements
 // and put an empty string as third:
 ['email', 'isnotempty', '']

 // you may have more than 3 elements in Filter Term array,
 // when the operator requires more than one value:
 ['grossamount','between','100.00','200.00']

在某些选择器字段中,你可以使用特殊值。

 // When filtering the user related fields, you can use:
 // Me (Current user): @CURRENT@
 // My Team (somebody from the team I am leading): @HIERARCHY@
 ['nextapprover','is','@CURRENT@']

 // The same is valid for Subsidiary, Department, Location, etc.
 // @CURRENT@ means MINE (Subsidiary, Department...)
 // @HIERARCHY@ means MINE or DESCENDANTS
 ["subsidiary","is","@HIERARCHY@"]

 // on selection fields you may use @ANY@ and @NONE@
 ['nextapprover','is','@NONE@']