2

So i executed this below query and it successfully returned records,

SELECT DurableId,EntityParticleId,Id,IsActive,IsDefaultValue,Label,ValidFor,Value FROM PicklistValueInfo where EntityParticleId = 'Case.Type'

but when i queried the same for custom object's picklist as shown below, it returns no records

SELECT DurableId,EntityParticleId,Id,IsActive,IsDefaultValue,Label,ValidFor,Value FROM PicklistValueInfo where EntityParticleId = 'Student__c.Hobby__c'

does PicklistValueInfo only works on Standard Objects ?

2 Answers 2

2

Try the below steps:

SELECT Id, DurableId
FROM FieldDefinition
WHERE EntityDefinitionId ='Client_Master__c'<Object Name>
AND QualifiedAPIName = 'Status__c' <Picklist>

enter image description here

SELECT DurableId,EntityParticleId,Id,IsActive,IsDefaultValue,Label,ValidFor,Value 
FROM PicklistValueInfo 
where EntityParticleId = '01I3SXXXXXXNufS.00N3S000002Zi9s'

enter image description here

1
  • Thank you it worked @Tamil, but i want to know why this does not work with directly from PicklistValueInfo ? does it not support the customObject and why does it works on standard Object can you give me a explanation ?
    – Aman Patil
    Feb 11, 2023 at 16:41
1

Or in one step...

SELECT Value,Label,IsActive
FROM PicklistValueInfo 
WHERE EntityParticle.EntityDefinition.QualifiedApiName = 'Client_Master__c'
AND EntityParticle.QualifiedApiName = 'Status__c'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .