5

Our admin created a new picklist field (Client_Temperature_Status__c) on the Account object and the values added are actually emojis selected using the Emoji Picker on Windows. Here are the values added to the picklist: 😑,😐,😁

We are currently using Azure Pipelines for our deployments and everything was working fine until this new field was added.

We started receiving the following error during our deployments:

Component Failures:
1.  objects/Account.object (Account.Business_Partner) -- Error: Picklist value: %3F%3F in picklist: Client_Temperature_Status__c not found (line 11490, column 18)

Upon a quick investigation, we noticed some "weird" behavior. After retrieving the org's metadata using the "sfdx force:source:retrieve" command, below is the content for the field's xml file. The contents is exactly what we expect.

<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Client_Temperature_Status__c</fullName>
    <externalId>false</externalId>
    <label>Client Temperature Status</label>
    <required>false</required>
    <trackFeedHistory>false</trackFeedHistory>
    <trackHistory>false</trackHistory>
    <type>Picklist</type>
    <valueSet>
        <valueSetDefinition>
            <sorted>false</sorted>
            <value>
                <fullName>😑</fullName>
                <default>false</default>
                <label>😑</label>
            </value>
            <value>
                <fullName>😐</fullName>
                <default>false</default>
                <label>😐</label>
            </value>
            <value>
                <fullName>πŸ˜„</fullName>
                <default>false</default>
                <label>πŸ˜„</label>
            </value>
        </valueSetDefinition>
    </valueSet>
</CustomField>

The problem begins after converting the source code into metadata api format prior deployment. To our surprise, in the Account.object file generated by the force:source:convert command, here is what we found for every record type we have in the Account object:

<picklistValues>
    <picklist>Client_Temperature_Status__c</picklist>
    <values>
        <fullName>%3F%3F</fullName>
        <default>false</default>
    </values>
</picklistValues>

All record types have actually only ONE value represented for Client_Temperature_Status__c field in the Account.object file, and not the three emoji values like we expected, even though they are added to the record type as per image below:

enter image description here

We know we could use some Ant Task to fix this in our Account.object file prior deployment, but we were wondering:

Anybody has faced this before? Any idea?

Thanks.

  • 8
    Having emoji picklist value API names strikes me as a very bad idea as this will likely cause difficulties in data loading, integrations and the like. Better to have the emoji as the label, and "Angry", "Meh" and "Happy" as the API names (values) for the picklist values instead in this case. – Phil W Sep 18 at 16:07
2

It looks like a Salesforce Metadata API bug rather than an sfdx force:source:convert bug. The picklistValues in the retrieved metadata only contain the single %3F%3F value.

Manually constructing the picklistValues and deploying it works:

        <picklistValues>
            <picklist>Happiness__c</picklist>
            <values>
                <fullName>😑</fullName>
                <default>false</default>
            </values>
            <values>
                <fullName>😐</fullName>
                <default>false</default>
            </values>
            <values>
                <fullName>πŸ˜„</fullName>
                <default>false</default>
            </values>
        </picklistValues>

Nonetheless, I would probably heed Phil W's suggestion to use English API Names for the options and emojis for the labels.

| improve this answer | |
  • Thank you so much... you are correct.. .Leaving the Labels as the emojis and fixing the "auto populated" API Name fixed the issue. Thank you so much!!! – Rodrigo Sep 18 at 18:32

Your Answer

By clicking β€œPost Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.