過濾期限
要理解過濾器表示式,我們應該從 Filter Term 開始。這是一個簡單的字串陣列,包含至少 3 個元素:
- 過濾 (欄位/加入欄位/公式/摘要)
- 運算子 (search.Operator)
- 值 (字串值(或字串值陣列),用作過濾器引數)
// 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@']