Newer Version Available
DataSourceField
Parent Type
This type extends the Metadata metadata type and inherits its
fullName field.
File Suffix and Directory Location
DataSourceField components have the suffix .dataSourceField and are stored in the dataSourceFields folder.
Version
DataSourceField components are available in API version 52.0 and later.
Special Access Rules
You need the Salesforce Customize Application permission to access this metadata type.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| datatype | string | Required. Text, number, or date data type. |
| dateFormat | string | The date format of date, time, date/time fields in this transport field. |
| externalName | string | Required. Name of the object in the external system. This is different from the developer name. |
| fieldFormula | string | Used for formula. |
| isDataRequired | boolean | If true, data is required for this field. Default value is false. |
| isFormula | boolean | If true, formula is required for this field. Default value is false. |
| length | int | Length of a string column. |
| masterLabel | string | Required. Field label. |
| precision | int | Used for currency and numeric accuracy. |
| primaryIndexOrder | int | If supplied, it indicates that this field is part of the primary key. The number value indicates the order of attributes if it's a compound primary key. Missing value means this field is not part of the primary key. |
| scale | int | Used for currency and numeric accuracy. |
| sequence | int | Required. The sequence of this source schema. |
| versionNumber | double | Required. The version of the data source object. |
Declarative Metadata Sample Definition
The following is an example of a DataSourceObject component.
1<DataSourceObject xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2 <dataSource>test1108</dataSource>
3 <dataSourceFields>
4 <fullName>DOB</fullName>
5 <datatype>D</datatype>
6 <externalName>DOB</externalName>
7 <isDataRequired>false</isDataRequired>
8 <masterLabel>DOB</masterLabel>
9 <sequence xsi:nil="true"/>
10 <versionNumber xsi:nil="true"/>
11 </dataSourceFields>
12 <externalRecordIdentifier>individuals_20200125_000000_csv</externalRecordIdentifier>
13 <masterLabel>test1108</masterLabel>
14 <objectType>Object</objectType>
15</DataSourceObject>The following is an example package.xml that references the previous definition.
1<types>
2 <members>test1108</members>
3 <name>DataSource</name>
4 </types>Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.