Tuesday 30 July 2024

How do we retrieve picklist values from standard picklist fields?

 Hi ,

 When we have to retrieve picklist values from the standard Picklist Fields (eg: Stage on Opportunity object , Industry on Account object etc.,) then we have to use StandardValueSet. 

In API version 38.0 and later, standard picklists are represented by the StandardValueSet type. In previous versions, standard picklists are represented by the CustomField type. 

Note:

The names of standard value sets and picklist fields are case-sensitive.


Example: 

To retrieve picklist values from Opportunity's Stage field then we have to use StandardValueSet as shown below.

package.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>OpportunityStage</members>
<name>StandardValueSet</name>
</types>
<version>58.0</version>
</Package>

Output:




This following link has standard picklists as standard value sets and their corresponding field names.



Reference:


No comments:

Post a Comment

How can you ensure that users can't bypass your SSO?

 Hi, To ensure that users can’t bypass your SSO system, disable their ability to log in with their Salesforce username and password so that ...