0

We have our org configured with person accounts, and have the Health Cloud managed package installed.

The Health Cloud managed package adds a field HealthCloudGA__Gender__c to the PersonAccount object.

On the Account/Contact object, we have added to the values in the picklist for this field. As in we have gone to Object Manager > Contact > Fields and Relationships > Gender > Values > added a value.

We have then made a custom recordtype for a person account, and version controlled it. In that record type, we reference one of the custom values we added to the picklist:

force-app/main/default/objects/PersonAccount/recordTypes/Member.recordType-meta.xml:

    <picklistValues>
        <picklist>HealthCloudGA__Gender__pc</picklist>
        <values>
            <fullName>Female</fullName>
            <default>false</default>
        </values>
        <values>
            <fullName>Male</fullName>
            <default>false</default>
        </values>
        <values>
            <fullName>ND</fullName>
            <default>false</default>
        </values>
    ...

When we try to deploy this metadata to a new scratch org, we get:

PersonAccount.OurCustomRecordType
Picklist value: ND in picklist: HealthCloudGA__Gender__pc not found

Here's where I'm stuck. I can't figure out how to retrieve these custom picklist values via sfdx. I've tried all sorts of combinations of things like:

sfdx force:source:retrieve -m 'StandardValueSet:AccountGender'
sfdx force:source:retrieve -m 'StandardValueSet:ContactGender'
sfdx force:source:retrieve -m 'ValueSet:ContactGender'
sfdx force:source:retrieve -m 'StandardValueSet:PersonAccountGender'
sfdx force:source:retrieve -m 'StandardValueSet:PersonAccountMemberGender'

And many more combinations. How can I use sfdx to retrieve the values in this picklist, so that we may deploy our custom record types?

3
  • 1
    Could be because it's managed, but does this work? sfdx force:source:retrieve -m CustomField:Account.HealthCloudGA__Gender__pc or Contact.HealthCloudGA__Gender__c
    – alesremta
    Jun 5, 2020 at 20:46
  • Or just -m CustomObject:Contact / Account
    – alesremta
    Jun 5, 2020 at 20:48
  • Also, you'll have to have the package installed in the scratch org
    – alesremta
    Jun 5, 2020 at 20:49

1 Answer 1

1

The comment on the original question pointed me in the right direction. Retrieving the field, not the value set, allowed for deploying this to a sandbox. I ran:

sfdx force:source:retrieve -m CustomField:Contact.HealthCloudGA__Gender__c

(Person account fields ending in __pc must be retrieved from the contact as __c)

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.