Newer Version Available

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

Platform Event Fields

Platform events contain standard fields. Add custom fields for your custom data.

To define a platform event in Salesforce Classic or Lightning Experience:

  1. From Setup, enter Platform Events in the Quick Find box, then select Platform Events.
  2. On the Platform Events page, click New Platform Event.
  3. Complete the standard fields, and optionally add a description.
  4. Click Save.
  5. To add a field, in the Custom Fields & Relationships related list, click New.
  6. Follow the custom field wizard to set up the field properties.

In Lightning Experience, platform events aren’t shown in the Object Manager’s list of standard and custom objects and aren’t available in Schema Builder.

Note

Standard Fields

Platform events include standard fields. These fields appear on the New Platform Event page.

Field Description
Label Name used to refer to your platform event in a user interface page.
Plural Label Plural name of the platform event.
Starts with a vowel sound If it’s appropriate for your org’s default language, indicate whether the label is preceded by “an” instead of “a.”
Object Name Unique name used to refer to the platform event when using the API. In managed packages, this name prevents naming conflicts with package installations. Use only alphanumeric characters and underscores. The name must begin with a letter and have no spaces. It cannot end with an underscore nor have two consecutive underscores.
Description Optional description of the object. A meaningful description helps you remember the differences between your events when you are viewing them in a list.
Deployment Status Indicates whether the platform event is visible to other users.

Custom Fields

In addition to the standard fields, add custom fields to customize your event. Platform event custom fields support only these field types.
  • Checkbox
  • Date
  • Date/Time
  • Number
  • Text
  • Text Area (Long)

ReplayId System Field

The ReplayId field identifies a platform event record and is used to get stored events that are within the retention window. Only a subscribed CometD client can retrieve past events using the ReplayId field. SOQL queries aren’t supported. This field is among the standard fields that the system populates for each platform event. Each replay ID is guaranteed to be higher than the ID of the previous event, but not necessarily contiguous for consecutive events. The ID is unique for the org and the channel.

API Name Suffix for Platform Events

When you create a platform event, the system appends the __e suffix to create the API name of the event. For example, if you create an event with the object name Low Ink, the API name is Low_Ink__e. The API name is used whenever you refer to the event programmatically, for example, in Apex.