0

I have the following metadata for my custom object

   <fields>
        <fullName>Meter_Type__c</fullName>
        <externalId>false</externalId>
        <label>Creative Type</label>        
        <trackHistory>false</trackHistory>
        <trackTrending>false</trackTrending>
        <type>Picklist</type>
    </fields>

When I try to deploy I get the following error:

Picklist attribute required on create

I'm using MavensMate, so I went ahead and open the custom object and modified the metadata to this:

  <fields>
        <fullName>Meter_Type__c</fullName>
        <externalId>false</externalId>
        <label>Creative Type</label>
        <required>false</required>
        <trackHistory>false</trackHistory>
        <trackTrending>false</trackTrending>
        <type>Picklist</type>
    </fields>

If I add the required = false got the following error:

Picklist attribute required on create

Then I add required = true got the following error:

 <fields>
    <fullName>Meter_Type__c</fullName>
    <externalId>false</externalId>
    <label>Creative Type</label>
    <required>true</required>
    <trackHistory>false</trackHistory>
    <trackTrending>false</trackTrending>
    <type>Picklist</type>
</fields>

Can not specify 'required' for a CustomField of type Picklist

I have tried with both Eclipse & MavensMate to deploy to my sandbox but I could not go further stuck with this error, not sure how to resolve!

What solutions have other people used to get around this?

1

Here is a picklist field example from a custom object that I know will deploy:

<fields>
    <fullName>Status__c</fullName>
    <deprecated>false</deprecated>
    <externalId>false</externalId>
    <label>Status</label>
    <picklist>
        <picklistValues>
            <fullName>Pending</fullName>
            <default>false</default>
        </picklistValues>
        <picklistValues>
            <fullName>Open</fullName>
            <default>false</default>
        </picklistValues>
        <picklistValues>
            <fullName>Closed</fullName>
            <default>false</default>
        </picklistValues>
        <picklistValues>
            <fullName>Incomplete</fullName>
            <default>false</default>
        </picklistValues>
        <sorted>false</sorted>
    </picklist>
    <trackFeedHistory>false</trackFeedHistory>
    <trackHistory>true</trackHistory>
    <trackTrending>false</trackTrending>
    <type>Picklist</type>
</fields>

You appear to be missing the picklist entry values for some reason - short term you could manually add at least one of them to get the field to deploy.

|improve this answer|||||
  • I have looked at the picklist and I found that I have Picklist Options: Strictly enforce picklist values what should be do in this case? – Nick Kahn Aug 29 '16 at 21:14
  • @NickKahn I've never had that turned on so don't know the consequence; would assume you need the set of entry values (unless you are using the global picklists beta). – Keith C Aug 29 '16 at 21:31

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.