function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KerrySainsburyKerrySainsbury 

Deployment of a custom label?

Hi Folks,

 

I've been using the ant-based deployment tool with great success, but am having issues deploying Custom Labels.

 

I have a custom label with a name of "Amazon_SQS_Access_Key", so I have put the following in my package.xml:

 

<types>
        <members>Amazon_SQS_Access_Key</members>
        <name>CustomLabels</name>
 </types>

 

... but when I try to download I get this error:

 

[sf:retrieve] package.xml - Entity of type 'CustomLabels' named 'Amazon_SQS_Access_Key' not found.

 

My usual "trick" to help me figure out the specific incantation required to get the "right" value into the <members> element is to use Eclipse to make up a package.xml for me, but it dies with a null pointer exception if I try to select a single CustomLabel (and subsequently will die again with "com.salesforce.ide.ui.packagemanifest.CustomObjectTypeNode cannot be cast to com.salesforce.ide.ui.packagemanifest.ComponentTypeNode"

 

in summary:

 

Does anybody know what I need to put in the <members> element of package.xml in order to download a custom label with a name of "Amazon_SQS_Access_Key"?

 

Thanks

Kerry

jhurstjhurst

Kerry,

 

I tested this and it looks like you can only pull down the entire set of custom labels.  You can do this with the wildcard:

 

 

<types>
    <members>*</members>
    <name>CustomLabels</name>
</types>

 

Can you log a support case so that we can get the documentation updated to relect this, or a bug logged if the behavior is incorrect?

 

Hope this helps.

 

Jay

 

KerrySainsburyKerrySainsbury

Thanks for your reply. I'd log a case, except that it keeps giving me an error when I click "Log a Case":

 

Customer Self-Service Temporarily Unavailable
We apologize that our self-service portal is not available at this time. Please try again shortly.

 

It was also doing this on Friday. I'd log a case about it, but, oh wait ... :-) Phoning somebody just feels like it would be too hard.

jhurstjhurst

Kerry,

 

Shoot me an email at [jhurst at salesforce dot com] with your username to the org you are getting the error on and I will find out what is happening.

 

Jay

SørenKrabbeSørenKrabbe

Any update on the label deployment issue, Kerry?

 

I find it very limiting that it's not possible to specify which labels you want to deploy with your package.xml, and the manual doesn't seem to have been updated with a clarification yet.

 

Thanks.

sandieforcesandieforce

any update on this ?

 

<types>       
<members>*</members>
        <name>CustomLabels</name>
    </types>

-- works.

 

but I want to deploy individual label.

 

 

jhurstjhurst

If you would like to deploy only a single label, then you should be able to edit your CustomLabels.labels file to reflect only the labels you wish to deploy.

 

So the full process could be (from sandbox to production for example):

 

1. Download the Metadata from sandbox using the widlcard in the package.xml fiel for CustomLabels

2. Prepare your metadata payload to update only what you want by editing the CustomLabels.labels file to only include the labels you wish to deploy

3. Push the metadata changes to your production org using the widcard in the package.xml (this will deploy all the labels that remain in the CustomLabels.labels file)

 

Hope this helps.

 

Jay

hari krishna 59hari krishna 59
Use below script in package.xml to get a single label.
<types>
        <members>Amazon_SQS_Access_Key</members>
        <name>CustomLabel</name>
 </types>

If you want to get more labels add as many members you want like below. This will allow you to deploy only specific labels.

<types>
        <members>Amazon_SQS_Access_Key</members>
        <members>Label1</members>
        <members>Label1</members>
        <name>CustomLabel</name>
 </types>
Laurentiu ChelaruLaurentiu Chelaru
Another way to push custom labels that works in version 55 and up:

1) Modify the manifest/package.xml by inserting the following entry (if it is not already in!):
    <types>
        <members>*</members>
        <name>CustomLabels</name>
    </types>
2) Under the main\default folder insert a new one called "customlabels", if it is not already created.
3) In this folder create an XML file having the name "CustomLabels.labels-meta.xml".
4) Upload a full definition(s) for the lablels you want to create.
The next rows show a two label XML code example for labels "descriptionOne" and "descriptionTwo":
<?xml version="1.0" encoding="UTF-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>descriptionOne</members>
        <members>descriptionTwo</members>
        <name>CustomLabel</name>
    </types>
    <labels>
        <fullName>descriptionOne</fullName>
        <language>en_US</language>
        <protected>false</protected>
        <shortDescription>descriptionOne</shortDescription>
        <value>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</value>
    </labels>
    <labels>
        <fullName>descriptionTwo</fullName>
        <language>en_US</language>
        <protected>false</protected>
        <shortDescription>descriptionTwo</shortDescription>
        <value>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.</value>
    </labels>
</CustomLabels>

5) Save the files and execute from the terminal the following:
sfdx force:source:deploy -p force-app/main/default/customlabels

6) Check deployment results in Salesforce Setup, Custom Labels.