You need to sign in to do that
Don't have an account?

access picklist field values using salesforce rest APIs
Hi Guys,
We have reuirement to get the picklist values in a custom field usinf APIs.
I have tried this
/services/data/v41.0/tooling/query?q=Select+MetaData+From+FieldDefinition+where+EntityDefinition.DeveloperName='Lead'+AND+FieldDefinition.QualifiedApiName='customfield Name'
But this is giving me a massive response to parse.
Is there any other easier way to do this?
Thanks,
Yamini.
We have reuirement to get the picklist values in a custom field usinf APIs.
I have tried this
/services/data/v41.0/tooling/query?q=Select+MetaData+From+FieldDefinition+where+EntityDefinition.DeveloperName='Lead'+AND+FieldDefinition.QualifiedApiName='customfield Name'
But this is giving me a massive response to parse.
Is there any other easier way to do this?
Thanks,
Yamini.
These 2 apex lines can do the thing for you:Execute them followed by your code to manage/process the picklist values:
Schema.DescribeFieldResult fieldResult = OfficeLocation__c.Country__c.getDescribe();
List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();