You need to sign in to do that
Don't have an account?
Bhola Vishwakarma
how to get all the picklist value using soql query
any query to get all the piclist values
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
any query to get all the piclist values
If you want all values in picklist field on object then it is not possible from SOQL. You need to use the describe call.
Here is the code :
You can change the object name here :
And the picklist field name here :
Thanks
Ankit Arora
Blog | Facebook | Blog Page
I'm trying to get all list of CASE TYPE (picklist) under CASE.
According to you, it's not possible from SOQL, correct? If so, can you provide a sample on how I can achieve this through Ruby (ie: I'm using databasedotcom gem).
Any pointers will be greatly appreciated.
Thanks,
Chad
Blog link: http://www.lwcforce.com/2020/07/retrieve-global-picklist-values-using.html
Hi All,
It is possible to query the values and labels using 3 SOQL queries:
1. To find the object details:
SELECT Id, DurableId, QualifiedApiName, DeveloperName, MasterLabel, Label from EntityDefinition
2. To find the fields involved in the object, 'objectname':
SELECT Id, EntityDefinitionId, QualifiedAPIName, FieldDefinitionId FROM EntityParticle WHERE EntityDefinition.QualifiedApiName ='objectname'
3. To fetch the values involved in that particular picklist field. Id represents FieldDefinitionId minus EntityDefinitionId:
SELECT Id,isdefaultValue,durableId,validFor, label,value FROM PicklistValueInfo Where EntityParticle.FieldDefinitionId ='objectname.Id'
Warm Regards,
Akhila