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
Miranda L 2Miranda L 2 

Fetch picklist values through R-Language (Third party) query?

1. Is it possible to fetch all the picklist field names along with the picklist field values available in Salesforce? Is there any object available in salesforce to query picklist values? Eg: Select Name From Picklist_Table__c ?
 
2. Using SOQL query is it possible to fetch the picklist values through R-language query? 
SwethaSwetha (Salesforce Developers) 
HI Miranda,
1. You can Get Values for a Picklist Field using API . Please see https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_picklist_values.htm

There is no specific table in salesforce. You will need below to perform the API Call
objectApiName—The API name of a supported object.
recordTypeId—The ID of the record type.
fieldApiName—The API name of the picklist field on the object.

2.SOQL might not fetch the picklist values since SOQL retrieves DATA and picklist values are METADATA.  That's why the getDescribe() was made available
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you
Miranda L 2Miranda L 2
Hello Swetha,
how could we call and we use getDescribe() through API call.
Please let me know
SwethaSwetha (Salesforce Developers) 
HI Miranda,
Correction:  the getDescribe() call in applicable for Apex and describeSObject() is for making the API call

I have used enterprise WSDL in SOAP UI and made a request to DescribeSobject

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId> *Your session ID*</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:describeSObject>
         <urn:sObjectType>account</urn:sObjectType>
      </urn:describeSObject>
   </soapenv:Body>
</soapenv:Envelope>

The result gave fields and its values. 
 
Let me know if this helps you or need more information.If it helps please mark as best. Thank you