DataSource represents the system from which data originated. It is a source-system definition used by data stream configuration: a DataSource is always required when creating a DataStreamDefinition.
Do not confuse the source-system definition with a source object or a data stream definition. Those are separate metadata components that can reference DataSource; those references do not make them children contained within it.
Key Elements
| Element | What the Element Controls |
|---|---|
masterLabel |
Required string. The name displayed for the data source in the user interface. |
prefix |
Required string. The prefix used to make Data Source Object records unique. Its purpose is record uniqueness, not display naming. |
Behavior and Constraints
Access to DataSource requires the Salesforce CustomizeApplication permission.
masterLabel and prefix serve different purposes, and both are required. Providing a display name does not replace the required uniqueness prefix. The uniqueness purpose of prefix applies to Data Source Object records.
The source-system requirement applies whenever a DataStreamDefinition is created. The stream definition holds the reference to the source through its own dataSource element.
Deployment and Retrieval
DataSource components use the .dataSource file suffix and are stored in the mktDataSources folder. A component definition must supply both masterLabel and prefix.
When preparing metadata that creates a DataStreamDefinition, include its required source-system dependency in the deployment plan. Treat the source definition and the components that reference it as separate metadata assets, not as nested content inside a DataSource file.
Relationships
Source-object, stream, and transaction-object metadata can each point to the source-system definition. In each relationship below, the dataSource element belongs to the referencing type.
Referenced By
-
DataSourceObject:dataSource -
DataStreamDefinition:dataSource -
MktDataTranObject:dataSource
Common Questions
Is DataSource required to create a DataStreamDefinition?
Yes. A DataSource is always required when creating a DataStreamDefinition. The stream definition references it through dataSource.
What is the difference between prefix and masterLabel?
masterLabel is the UI name. prefix is used to make Data Source Object records unique. Both elements are required.
Where are DataSource metadata files stored?
They are stored in the mktDataSources folder and use the .dataSource suffix.
What permission is needed to access DataSource?
The Salesforce CustomizeApplication permission is required.