/
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; } } }