NetSuite保存的机会搜索公式在特定时间内关闭

时间:2019-01-09 20:38:40

标签: sql netsuite

我想创建一个“保存的搜索”以显示所有在2018年关闭的机会。如何编写公式过滤

  

状态=胜诉并按日期设置= 2018?

我正在尝试确定实际日期状态已更改为“已关闭”,并过滤为仅在2018年关闭的日期

module Test

import IO;
import ParseTree;

lexical Ident = [A-Za-z]+ !>> [a-zA-Z];
layout Whitespace = [\t\n\r\ ]*;

syntax Expression 
  = Ident
  | "new" Expression
  > Expression "(" {Expression ","}* ")"
  > right Expression "." Expression
  ;

void main() {
  Expression ex = parse(#Expression, "a().b()");
  println(ex);

  Expression ex2 = parse(#Expression, "new a().b()");
  println(ex2);
}

需要保存搜索2018年封闭式胜算的最高代表的奖项。

1 个答案:

答案 0 :(得分:2)

There is an Actual Close field on the Opportunity record that holds the date the opportunity status was changed to either Closed Won or Closed Lost.

You should be able to add the following criteria without a formula:

Opportunity Status = Closed Won
Actual Close within last year (2018)

If you use the system notes to filter the actual time the status was changed to Closed Won, you risk returning multiple records for each opportunity if the status was changed to Closed Won, then back to an earlier status, then back to Closed Won again. It could be done like this, again without needing a formula.

Opportunity Status = Closed Won
System Notes : New Value starts with Closed Won
System Notes : Date within last year (2018)

If you must use a formula to find these records you can use

case 
    when {entitystatus} = 'Closed Won' 
         and {systemnotes.newvalue} = 'Closed Won' 
         and {systemnotes.date} >= '1/1/2018' 
         and {systemnotes.date} <= '12/31/2018' then 1 
    else 0 
end

equal to 1

相关问题