Supporting Retail Home Filters
Retail Home users can filter the data displayed in their dashboard by Merchandise Hierarchy, if this feature was enabled in the Retail Home installation.
Retail Home passes these optional filter values as query parameters to the REST Service endpoint that is configured in APEX.
In the SQL query of an APEX REST Service endpoint, reference these filter values using following variables:
-
:departmentId
-
:classId
-
:subclassId
The following query example shows how different rows can be returned depending on what departmentId
value
is passed in the REST service query parameter:
select 'Metric 1' NAME, 1234567890 VALUE, 'S' VALUE_FORMAT, 'USD' VALUE_LABEL, 'critical' INDICATOR from dual union select 'Order Count' NAME, 8 VALUE, NULL VALUE_FORMAT, NULL VALUE_LABEL, NULL INDICATOR from dual where :departmentId IS NULL union select 'Order Count' NAME, 10 VALUE, NULL VALUE_FORMAT, NULL VALUE_LABEL, NULL INDICATOR from dual where :departmentId = 1000
This idea can be extended to test for different values and to incorporate the classId and subclassId values as well.