# Create Components for Forecast Pages

Create custom Aura components that are available to add to Lightning forecasts pages.

To add a custom template to a Lightning forecasts page, implement the `lightning:forecastingTemplate` interface.

To allow the component access to a Lightning forecasts page, implement the `lightning:availableForForecastingPage` interface.

Upon initialization, the component attempts to populate the following attributes to provide some forecast context. The attributes include:

- `contextPeriodIds`—The time period IDs from the user context.

  ```nolang
  <aura:attribute name="contextPeriodIds" type="String[]" />
  ```

- `currencyIsoCode`—The ISO code of the unit of currency that the user views.

  ```nolang
  <aura:attribute name="currencyIsoCode" type="String" />
  ```

- `forecastingOwnerId`—The forecast owner's user ID.

  ```nolang
  <aura:attribute name="forecastingOwnerId" type="String" />
  ```

- `forecastingTerritoryId`—The forecast territory's ID.

  ```nolang
  <aura:attribute name="forecastingTerritoryId" type="String" />
  ```

- `forecastingTypeId`—The user’s selected forecast type.

  ```nolang
  <aura:attribute name="forecastingTypeId" type="String" />
  ```

- `scope`—The supported scope type. If `scope` is undefined or null, a single territory or role page is loaded.

  ```nolang
  <aura:attribute name="scope" type="String" />
  ```

  ```nolang
  SupportedScopeType  : {'my_territory'}
  ```

Lightning forecasts pages don’t support any standard or custom events published from custom components.

When the Lightning forecasts page changes, such as owner or forecast type, the page header publishes a Lightning message. You can subscribe to the `lightning__forecasting_flexipageUpdated` LightningMessageChannel to update your custom components based on Lightning forecasts page header changes.

:::note
To ensure that custom components appear correctly, enable them to adjust to variable widths.
:::

- **[Sample Custom Components for Forecasts Pages](/docs/platform/aura-platform/guide/components-custom-for-app-builder-forecasts-page.md)**

  Review samples of custom Aura components that you can implement in Lightning forecasts pages. Lightning forecasts pages don’t support any standard or custom events published from custom components.

**See Also**

- [Communicating Across the DOM with Lightning Message Service](/docs/platform/aura-platform/guide/message-channel-intro.md)
- [*Lightning Web Components Dev Guide*: Subscribe and Unsubscribe from a Message Channel](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_message_channel_subscribe)
- [*Aura Component Reference*: Message Channel](https://developer.salesforce.com/docs/component-library/bundle/lightning\:messageChannel/documentation)
