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
alfo72alfo72 

Creating Package.xml with VS and getting Picklist Error

Just getting started here, crash course in Packaging for a new org we are building.

Created a scratch org, made some basic changes:
  • 5 x Account Record Types
  • 6 x Custom Text/Number Fields
  • Amended a Layout
  • Gave Sys Admin Profile field permissions.
Pulled the changes into my VS and Repository.

Now want to create a package and configured package.xml as:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    
    <types>
        <members>Account</members>
        <name>CustomObject</name>
    </types>
    <types> 
        <members>Account.AccountSource</members> 
        <name>CustomField</name> 
    </types> 
    <types> 
        <members>LeadSource</members> 
        <name>StandardValueSet</name> 
    </types> 
    <types>
        <members>Account.CXC_Client</members>
        <members>Account.CXC_Contractor_Company</members>
        <members>Account.CXC_Contractor_Employee</members>
        <members>Account.CXC_Entity</members>
        <members>Account.CXC_Service_Partner</members>
        <members>Account.CXC_Supplier</members>
        <name>RecordType</name>
    </types>
    <types>
        <members>Admin</members>
        <name>Profile</name>
    </types>

Get the following error :

Account.Client: Picklist value: Advertisement in picklist: AccountSource not found

Lots of reading and links and changes and variations but still can't get it working.  Do I have the order wrong?  Do I need to do something else first?  Everything i have read suggests it is the right approach.
Best Answer chosen by alfo72
alfo72alfo72
Solved this myself with more experience.  Reading about Lead Source and adding LeadSource SVS to the VS Code and then packaging

All Answers

alfo72alfo72
Solved this myself with more experience.  Reading about Lead Source and adding LeadSource SVS to the VS Code and then packaging
This was selected as the best answer
Rajnish Songara 1Rajnish Songara 1
Hi @alfo72 Please explain what exactly you did to resolve this issue. You last reply is not clear answer to this issue.
alfo72alfo72

Rajnish

It's been a while (over 2 years).

Essentially there were no picklist values for the standard field called AccountSource, so it throws an error on packaging.  AccountSource uses the LeadSource Standard Value Set.

So in your package you would need to make sure you are deploying LeadSource.standardValueSet metadata with the relevant values before deploying AccountSource.

https://help.salesforce.com/s/articleView?id=000317064&type=1