Skip to content

Commit 0134f02

Browse files
committed
Add workaround to handle filters on KPI
We need to use DynamicObject to use %Size() call in system libs while working with filters from request.
1 parent 77d79a2 commit 0134f02

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

MDX2JSON/AbstractREST.cls

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ ClassMethod ConvertRequestBody() As %Status
6565
return:$$$ISERR(st) st
6666
return:'$IsObject(obj) $$$ERROR($$$ArgumentIsNotAnObject,"Body")
6767

68+
// if this is a KPI request content
69+
if ($FIND(obj.KPI, ".kpi") = ($LENGTH(obj.KPI) + 1)) {
70+
// Prepare DynamicObject instead of proxyObject
71+
// Without this we got error later "ERROR #5002: ObjectScript error: <METHOD DOES NOT EXIST>zWriteJSONfromKPI+8^MDX2JSON.REST.1 *%Size,%Library.ListOfObjects
72+
// while applying filters to KPI
73+
set obj = {}.%FromJSON(content)
74+
}
75+
6876
set %request.Content = obj // obj here is a valid UTF8 proxyObject with required property
6977
return $$$OK
7078
}

0 commit comments

Comments
 (0)