/
Retrieving Picklist Values
Retrieving Picklist Values
Values for Pick-list fields in Salesforce can be accessed as strings. The following example is for a built-in field, but the same approach will work for custom fields.
public void GetLeadSourcePicklistValues() { SalesforceSession salesforceSession = SessionTest.GetActiveSession(); Field field = FieldService.FieldFromObject("Contact", salesforceSession , "LeadSource"); if(field.type == fieldType.picklist) { PicklistEntry[] picklistValues = field.picklistValues; foreach (PicklistEntry picklistValue in picklistValues) { bool isDefaultValue = picklistValue.defaultValue; string value = picklistValue.value; } } }
Related content
Create Multiple Records in Salesforce with One API Call
Create Multiple Records in Salesforce with One API Call
Read with this
Retrieving Multipicklist Field Values
Retrieving Multipicklist Field Values
More like this
Handling Custom Picklists
Handling Custom Picklists
More like this
Working with Salesforce Metadata
Working with Salesforce Metadata
More like this
Accessing Custom Objects and Custom Fields
Accessing Custom Objects and Custom Fields
More like this
Working with the SalesforceGenericEntity
Working with the SalesforceGenericEntity
More like this