Diderik
01/21/2021, 9:28 AMsearch.createFilter()
, filter expressions and making the search in the UI and then loading it with search.load()
but all of those methods result in the INVALID_SRCH_SUMMARY_TYP
error.
My search needs to filter on customers who have X tasks with specific criteria, so I have to count the result of a formula. I have sort of done that before, but in that case I only needed to count the amount of subrecords on a custom record. That also used a formula, but copying that and adjusting it to fit my needs for this search also resulted in that error.battk
01/21/2021, 9:31 AMbattk
01/21/2021, 9:32 AMbattk
01/21/2021, 9:32 AMDiderik
01/21/2021, 9:33 AMDiderik
01/21/2021, 9:34 AMbattk
01/21/2021, 9:35 AMbattk
01/21/2021, 9:36 AMDiderik
01/21/2021, 9:36 AMsearch.createFilter({
name: 'formulanumeric',
formula: "CASE WHEN {task.custevent_taak_type.id} = 4 AND {task.status.id} != 'COMPLETE' THEN {task.internalid} ELSE null END",
operator: 'is',
values: "1",
summary: search.Summary.COUNT,
})
[
"formulanumeric: CASE WHEN count(CASE WHEN {task.custevent_taak_type.id} = 4 AND {task.status.id} != 'COMPLETE' THEN {task.internalid} ELSE null END) = 3 THEN 1 ELSE" +
" 0 END",
"is",
"1",
]
Diderik
01/21/2021, 9:38 AMDiderik
01/21/2021, 9:39 AMbattk
01/21/2021, 9:41 AMbattk
01/21/2021, 9:42 AMDiderik
01/21/2021, 9:43 AMbattk
01/21/2021, 9:43 AMbattk
01/21/2021, 9:44 AMbattk
01/21/2021, 9:44 AMDiderik
01/21/2021, 9:44 AMbattk
01/21/2021, 9:45 AMDiderik
01/21/2021, 9:50 AMDiderik
01/21/2021, 9:50 AM[
"count(formulanumeric: CASE WHEN {task.custevent_taak_type.id} = 4 AND {task.status.id} != 'COMPLETE' THEN 1 ELSE null END)",
"equalto",
"1"
]
Diderik
01/21/2021, 9:57 AMExport as Script Not Supported
battk
01/21/2021, 10:01 AMDiderik
01/21/2021, 10:04 AMDiderik
01/21/2021, 10:04 AMbattk
01/21/2021, 10:09 AMDiderik
01/21/2021, 10:12 AMDiderik
01/21/2021, 10:18 AMstalbert
01/21/2021, 1:43 PMDiderik
01/21/2021, 1:53 PMstalbert
01/21/2021, 1:54 PM