Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
RTRReportResult.FlatlistRowIterable
This class represents a set of rows in an RTR Report UI Flatlist component.
Namespace
The RTRReportResult.FlatlistRowIterable class implements the Iterator<FlatlistRow> interface. You can use this class in batch processes.
The supported modifiers are global and virtual.
1cgcloudSupported Methods
| Method signature | Description | Version |
|---|---|---|
| boolean hasNext() | Returns true if a record is retrievable. | 60.0 |
| FlatlistRow next() | Returns the next record in the dataset. If no more records are present, it throws an exception. | 60.0 |
Example Implementation
1// Extract the Flatlist from the result
2// - The component name must match its 'uimapping' name
3// - The result must be casted to the correct type.
4cgcloud.RTRReportResult.Flatlist flatlist = (cgcloud.RTRReportResult.Flatlist) reportResult.getComponent('FlatList');
5
6// Retrieve the rows Iterable object
7// All rows can be retrieved with the parameter-less "getRows"
8cgcloud.RTRReportResult.FlatlistRowIterable iterator = flatlist.getRows('Promo-Product');
9
10// Iterate over all the rows
11while (iterator.hasNext()) {
12 cgcloud.RTRReportResult.FlatlistRow row = iterator.next();
13
14 // Extract column data. We assume the specified columns are in the report
15
16 // Dimension information can be extracted with <dimension name>.<field>
17 String promotionId = String.valueOf(row.getColumnValue('promotiondimension.id'));
18 // KPI Value information can be extracted by querying the KPI Name
19 Decimal kpiValue = (Decimal) row.getColumnValue('ProPlanIncrVolume');
20
21 system.debug('Values: ' + promotionId + ' ' + kpiValue);
22}