RTRReportResult Class
Use this class to execute the Trade Promotion Management Real Time Reporting (RTR) report and access the report data.
Here’s an example of how to use Apex to run the Trade Promotion Management Real Time Reporting reports.
This returns an instance of a RTRReportResult object after running the report. Use the methods provided by the RTRReportResult class to access the report data.
Filters can be specified for the report execution. The report filters specified match the filters defined in the RTR Report Metadata configuration (RTR Report Configuration SObject record). Depending on the filter type, the expected filter must have a specific structure or type.
singleselect
Here’s an example of how the report’s filter metadata looks:
Here’s an example of how the filter using Apex looks:
multiselect
Here’s an example of how the report’s filter metadata looks:
Here’s an example of how the filter using Apex looks:
periodmonth
Here’s an example of how the report’s filter metadata looks:
Here’s an example of how the filter using Apex looks:
The filter must be represented by an object with the year, start, and total properties.
periodweek
Here’s an example of how the report’s filter metadata looks:
Here’s an example of how the filter using Apex looks:
The filter must be represented by an object with the year, start, and total properties.
hidden
Here’s an example of how the report’s filter metadata looks:
Here’s an example of how the filter using Apex looks:
The filter must be represented with a string.
fixed
Here’s an example of how the report’s filter metadata looks:
Here’s an example of how the filter using Apex looks:
The filter must be represented with a string.
subaccount
Here’s an example of how the report’s filter metadata looks:
Here’s an example of how the filter using Apex looks:
The filter must be represented with a List of strings.
The following are methods for RTRReportResult.
-
execute(String name, String salesOrg, Map<String, Object> filters)
Execute a RTR Report and retrieve all the Report data.
-
Retrieve an instance of the Reporting UI component.
Execute a RTR Report and retrieve all the Report data.
static RTRReportResult execute(String name, String salesOrg, Map<String, Object> filters)
-
name: Type:String. The name of the RTR report configuration to execute.
-
salesOrg: Type:String. The Salesforce org name to execute the report on.
-
filters: Type:String. Report filters as defined in the RTR report metadata.
The filters attribute must align with the expected filters as defined in the RTR reporting configuration.
Type:RTRReportResult
Retrieve an instance of the Reporting UI component.
static RTRReportResult execute(String name, String salesOrg, Map<String, Object> filters)
- name: Type:String. The name of the reporting component as defined in the report metadata
uimapping.
Type:ReportComponent
- For the Flatlist component, specify the response to
RTRReportResult.FlatList - For the Scorecard component, specify the response to
RTRReportResult.ScoreCard