Newer Version Available

This content describes an older version of this product. View Latest

ReportMetadata Class

Contains report metadata for a tabular, summary, or matrix report.

Namespace

Reports

Usage

Report metadata gives information about the report as a whole, such as the report type, format, summary fields, row or column groupings, and filters that are saved to the report. You can use the ReportMetadata class to retrieve report metadata and to set metadata that can be used to filter a report.

ReportMetadata Methods

The following are methods for ReportMetadata. All are instance methods.

getAggregates()

Returns unique identifiers for summary or custom summary formula fields in the report.

Syntax

public LIST<String> getAggregates()

Return Value

Type: List<String>

Usage

For example:

  • a!Amount represents the average for the Amount column.
  • s!Amount represents the sum of the Amount column.
  • m!Amount represents the minimum value of the Amount column.
  • x!Amount represents the maximum value of the Amount column.
  • s!<customfieldID> represents the sum of a custom field column. For custom fields and custom report types, the identifier is a combination of the summary type and the field ID.

getCurrencyCode()

Returns report currency, such as USD, EUR, or GBP, for an organization that has multicurrency enabled. The value is null if the organization does not have multicurrency enabled.

Syntax

public String getCurrencyCode()

Return Value

Type: String

getDetailColumns()

Returns unique API names (column names) for the fields that contain detailed data. For example, the method might return the following values: “OPPORTUNITY_NAME, TYPE, LEAD_SOURCE, AMOUNT.”

Syntax

public LIST<String> getDetailColumns()

Return Value

Type: List<String>

getDeveloperName()

Returns the report API name. For example, the method might return the following value: “Closed_Sales_This_Quarter.”

Syntax

public String getDeveloperName()

Return Value

Type: String

getGroupingsAcross()

Returns the unique identifiers for each column grouping in a report.

Syntax

public LIST<Reports.GroupingInfo> getGroupingsAcross()

Return Value

Type: List<Reports.GroupingInfo>

Usage

The identifier is:

  • An empty array for reports in summary format, because summary reports don't include column groupings
  • BucketField_(ID) for bucket fields
  • The ID of a custom field when the custom field is used for a column grouping

getGroupingsDown()

Returns the unique identifiers for each row grouping in a report.

Syntax

public LIST<Reports.GroupingInfo> getGroupingsDown()

Return Value

Type: List<Reports.GroupingInfo>

Usage

The identifier is:

  • BucketField_(ID) for bucket fields
  • The ID of a custom field when the custom field is used for grouping

getHistoricalSnapshotDates()

Returns a list of historical snapshot dates.

Syntax

public LIST<String> getHistoricalSnapshotDates()

Return Value

Type: List<String>

getId()

Returns the unique report ID.

Syntax

public Id getId()

Return Value

Type: Id

getName()

Returns the report name.

Syntax

public String getName()

Return Value

Type: String

getReportBooleanFilter()

Returns logic to parse custom field filters. The value is null when filter logic is not specified.

Syntax

public String getReportBooleanFilter()

Return Value

Type: String

getReportFilters()

Returns a list of each custom filter in the report along with the field name, filter operator, and filter value.

Syntax

public LIST<Reports.ReportFilter> getReportFilters()

Return Value

Type: List<Reports.ReportFilter>

getReportFormat()

Returns the format of the report.

Syntax

public Reports.ReportFormat getReportFormat()

Return Value

Type: Reports.ReportFormat

Usage

This value can be:

  • TABULAR
  • SUMMARY
  • MATRIX

getReportType()

Returns the unique API name and display name for the report type.

Syntax

public Reports.ReportType getReportType()

Return Value

Type: Reports.ReportType

setHistoricalSnapshotDates(LIST<String>)

Sets a list of historical snapshot dates.

Syntax

public Void setHistoricalSnapshotDates(LIST<String> historicalSnapshot)

Parameters

historicalSnapshot
Type: List<String>

Return Value

Type: Void

setReportBooleanFilter(String)

Sets logic to parse custom field filters.

Syntax

public Void setReportBooleanFilter(String reportBooleanFilter)

Parameters

reportBooleanFilter
Type: String

Return Value

Type: Void

setReportFilters(LIST<Reports.ReportFilter>)

Sets a list of each custom filter in the report along with the field name, filter operator, and filter value.

Syntax

public Void setReportFilters(LIST<Reports.ReportFilter> reportFilters)

Parameters

reportFilters
Type: List<Reports.ReportFilter>

Return Value

Type: Void