Retrieving Multipicklist Field Values

You can get the list of all available values (options) using the code below. Note the values enum is generated only for picklist type, not for the multi picklist type. 


/// <summary> 
/// Return the multi select options from an objects schema 
/// </summary> 

public void
GetMulitSelectPicklistValues() 
{ 
	SalesforceSession salesforceSession = SessionTest.GetActiveSession(); 
	AccountService accountService = new AccountService(salesforceSession); 
	FieldService accountFieldService = FieldService.Instance(Account.SFType, salesforceSession); 
	
	// use a string to retrieve the list
	SalesforceField multiSelectList = accountFieldService.FieldFromObject("S4S__Multi_Select_List__c"); 


	// or use the object attributes to retrieve the list
	SalesforceField ratingField = accountFieldService.FieldFromObject(Account.Fields.Rating);

	foreach (PicklistEntry picklistEntry in multiSelectList.picklistValues)
	{ 
		System.Diagnostics.Debug.WriteLine(picklistEntry.label);
	} 
}