1

我正在使用 SF Rest API 运行一些 SOQL 查询.. 对 Case 对象运行查询,试图获取其当前 Age(= 自案例打开以来经过的天数)。

有没有办法得到案件的实际年龄?我知道 SF 有自己的公式字段,可以在报告中使用,但似乎找不到 API 字段名称..

创建公式并不是那么好,因为它还会计算已结案的年龄(意味着继续计算结案后的天数..)

有任何想法吗?

4

1 回答 1

3

Make a conditional formula field. If the case is open, there is no closed date, then calculate from the current time, otherwise get difference between the two dates, Closed and Created.

(I forget the actual syntax)

IF (ISNULL(ClosedDate),
DATEVALUE(NOW() - CreatedDate), 
DATEVALUE(ClosedDate - CreatedDate))
于 2013-02-17T09:26:09.690 回答