CustomLabels
The CustomLabels metadata type allows you to create custom labels that can be localized for use in different languages, countries, and currencies.
Custom labels are custom text values, up to 1,000 characters in length that can be accessed from Apex classes or Visualforce pages. For more information, see “Custom Labels” in Salesforce Help.
This type extends Metadata and inherits its fields.
Master custom label values are stored in the CustomLabels.labels file. Translations for custom labels can be retrieved through Translations in Metadata API. Translations are stored in files under the translations folder with the name format of localeCode.translation, where localeCode is the locale code of the translation language. The supported locale codes are listed in Language.
Introduced in API version 14.0.
-
Type: string
-
Required: No
-
Description: Required. The name of the custom label bundle.
Inherited from Metadata, this field is defined in the WSDL for this metadata type. It must be specified when creating, updating, or deleting. See
createMetadata()to see an example of this field specified for a call.
- Type: CustomLabel[]
- Required: No
- Description: A list of custom labels.
This metadata type represents a custom label.
This type extends Metadata and inherits its fields.
- Type: string
- Required: No
- Description: A comma-separated list of categories for the label. This field can be used in filter criteria when creating custom label list views. Maximum of 255 characters.
-
Type: string
-
Required: No
-
Description: Required. The name of the custom label.
Inherited from Metadata, this field is defined in the WSDL for this metadata type. It must be specified when creating, updating, or deleting. See
createMetadata()to see an example of this field specified for a call.
- Type: string
- Required: Yes
- Description: Required. The language of the translated custom label.
- Type: boolean
- Required: Yes
- Description: Required. Indicates whether this component is protected (
true) or not (false). Protected components can’t be linked to or referenced by components created in the installing organization.
- Type: string
- Required: Yes
- Description: Required. An easily recognizable term to identify this custom label. This description is used in merge fields.
- Type: string
- Required: Yes
- Description: Required. The translated custom label. Maximum of 1000 characters.
This is a sample XML definition of a custom label component.
This is a sample manifest file for retrieving all custom labels in the organization by using the CustomLabels type.
This is a sample manifest file for retrieving two custom labels by name. Notice it uses the CustomLabel singular type.
Use CustomLabels with the wildcard character (*) for members in the package.xml manifest file to retrieve all custom labels that are defined in your organization. CustomLabels doesn’t support retrieving one or more custom labels by name. To retrieve specific labels by name, use CustomLabel and specify the label names as members.
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.
Before you use the CustomLabels metadata type, understand the limitations of this feature. You can’t retrieve the CustomLabels metadata type with a namespace.