简体   繁体   English

NetSuite Saved Search使用带有HTML的公式(数字)进行格式化

[英]NetSuite Saved Search using formula (numeric) with html for formatting

I need to make a saved search which sum's all quotes made per sales rep by month and highlight certain cells based on sum amount of numeric formula. 我需要进行保存的搜索,按月将每个销售代表的所有报价加起来,并根据数字公式的总和突出显示某些单元格。

This is what I have now (it's a Saved Transaction Search) 这就是我现在所拥有的(这是一个保存的交易搜索)

Criteria 标准
Type is Quotation 类型是报价
Main Line is True 主线为真
Sales Rep is any of , ,... 销售代表是任意的,...
Date is after start of this year. 日期是今年开始之后。

Result 结果
Sales Rep Group 销售代表小组
Formula (Numeric) SUM CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '01', then 1 else 0 end. CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '01', then 1 else 0 end.公式(数字) CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '01', then 1 else 0 end.
Formula (Numeric) SUM CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '02', then 1 else 0 end. CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '02', then 1 else 0 end.公式(数值) CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '02', then 1 else 0 end.
Formula (Numeric) SUM CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '02', then 1 else 0 end. CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '02', then 1 else 0 end.公式(数值) CASE WHEN to_char({custbody_Lastupdateddate}, 'MM')= '02', then 1 else 0 end. ...This continues until May. ...这一直持续到五月。

I now need to highlight the cell based on quantity of quotes per rep per month. 现在,我需要根据每个代表每月的报价数量突出显示该单元格。 I have dabbled with HTML but cannot seem to figure out how to write the formula to accomplish this. 我涉猎HTML,但似乎无法弄清楚如何编写公式来完成此操作。

Does anyone have any feedback? 有人有反馈吗? Thanks in advance. 提前致谢。

You can return HTML from your formula, using Formula(text). 您可以使用Formula(text)从公式返回HTML。 The trick is to move your aggregate functions inside the formula, and simply use MINIMUM as the Summary Type. 诀窍是将聚合函数移到公式内,并简单地使用MINIMUM作为摘要类型。 The following formula should get you close to what you want: 下面的公式应该使您接近所需的内容:

CASE
   WHEN
      COUNT(
      CASE
         WHEN
            to_char({trandate}, 'MM') = '01' 
         THEN
            {internalid} 
      END
) > 50  --more than 50 quotes in the month should be green
   THEN
     '<div style="color:white;background-color:green;">' || 
COUNT(
      CASE
         WHEN
            to_char({trandate}, 'MM') = '01' 
         THEN
            {internalid} 
      END
) || '</div>' 
   ELSE   --the rest will be red
      '<p style="color:white;background-color:red;">' || COUNT(
      CASE
         WHEN
            to_char({trandate}, 'MM') = '01' 
         THEN
            {internalid} 
      END
) || '</p>' 
END

You'll see I used <div> and <p> tags - both work. 您会看到我使用了<div><p>标记-都可以使用。 <span> and <table> tags work too; <span><table>标签也可以使用; what you end up using might depend on other specific display characteristics I won't go into here. 您最终使用的内容可能取决于其他特定的显示特性,我将不在这里介绍。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM