When using the Salesforce Metadata API to retrieve Account.AccountSource picklist values, a package.xml file that specifies the CustomField member type returns an Account.object file without any picklist values. This is a known behavior because standard picklist values are not stored directly on the field definition in the Metadata API.
Example package.xml that returns no picklist values:
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Account.AccountSource</members> <name>CustomField</name> </types> <version>38.0</version> </Package>
Returned Account.object file:
<?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <fields> <fullName>AccountSource</fullName> <trackFeedHistory>false</trackFeedHistory> <type>Picklist</type> </fields> </CustomObject>
Starting with Metadata API version 38.0, standard picklist values are managed separately through the StandardValueSet Metadata type — not through CustomField. Account.AccountSource shares its picklist values with LeadSource, which is the StandardValueSet name to use.
This article explains how to retrieve Account.AccountSource picklist values using the Salesforce Metadata API by using the StandardValueSet Metadata type instead of CustomField.
To retrieve Account.AccountSource picklist values, add a StandardValueSet member to your package.xml. Use LeadSource as the member name, because Account.AccountSource shares its picklist values with the LeadSource StandardValueSet.
Updated package.xml — include both CustomField and StandardValueSet entries:
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Account.AccountSource</members> <name>CustomField</name> </types> <types> <members>LeadSource</members> <name>StandardValueSet</name> </types> <version>38.0</version> </Package>
<?xml version="1.0" encoding="UTF-8"?> <StandardValueSet xmlns="http://soap.sforce.com/2006/04/metadata"> <sorted>false</sorted> <standardValue> <fullName>Web</fullName> <default>false</default> </standardValue> <standardValue> <fullName>Phone Inquiry</fullName> <default>false</default> </standardValue> <standardValue> <fullName>Partner Referral</fullName> <default>false</default> </standardValue> <standardValue> <fullName>Purchased List</fullName> <default>false</default> </standardValue> <standardValue> <fullName>Other</fullName> <default>false</default> </standardValue> </StandardValueSet>
<?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <fields> <fullName>AccountSource</fullName> <trackFeedHistory>false</trackFeedHistory> <type>Picklist</type> </fields> </CustomObject>
The valid StandardValueSet names can be found at here.
000383067

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.